1
0
mirror of https://github.com/wting/autojump synced 2024-09-28 22:10:45 +00:00
wting_autojump/git-version.sh
2011-09-15 23:21:35 -07:00

12 lines
364 B
Bash
Executable File

#!/usr/bin/env bash
# add git revision to autojump
gitrevision=`git rev-parse HEAD`
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 > autojump-version
mv -f autojump-version autojump
chmod a+rw autojump