diff --git a/git-version.sh b/git-version.sh index 7cc2e06..61fe82b 100755 --- a/git-version.sh +++ b/git-version.sh @@ -1,5 +1,12 @@ #!/usr/bin/env bash # add git revision to autojump + +# Fail silently if there is no git directory, ie. if the user installed from a regular download +if [[ ! -d .git ]] +then + exit +fi + gitrevision=`git describe` if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then gitrevision=$gitrevision"-dirty"