1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

avoid failing when the user didn't install from git

This commit is contained in:
Joël Schaerer 2011-09-24 11:54:40 +02:00
parent b6eb9fb81b
commit 46ba7d61f0

View File

@ -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"