1
0
mirror of https://github.com/wting/autojump synced 2024-09-29 22:40:46 +00:00
wting_autojump/git-version.sh
2011-09-24 11:54:40 +02:00

15 lines
406 B
Bash
Executable File

#!/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"
fi
sed -i "s/^AUTOJUMP_VERSION = \".*\"$/AUTOJUMP_VERSION = \"$gitrevision\"/" autojump