1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00
wting_autojump/git-version.sh
2011-09-21 10:23:30 -07:00

14 lines
377 B
Bash
Executable File

#!/usr/bin/env bash
if [ -d .git ];
then
# add git revision to autojump
gitrevision=`git describe`
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
gitrevision=$gitrevision"-dirty"
fi
sed -e "s/^AUTOJUMP_VERSION = \".*\"$/AUTOJUMP_VERSION = \"git revision $gitrevision\"/" autojump.py > autojump
else
cp autojump.py autojump
fi
chmod a+rx autojump