mirror of https://github.com/wting/autojump
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
472 B
21 lines
472 B
#!/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
|
|
|
|
if [ -z "$1" ]
|
|
then
|
|
gitrevision=`git describe`
|
|
if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then
|
|
gitrevision=$gitrevision"-dirty"
|
|
fi
|
|
else
|
|
gitrevision="$1"
|
|
fi
|
|
|
|
sed -i "s/^AUTOJUMP_VERSION = \".*\"$/AUTOJUMP_VERSION = \"$gitrevision\"/" autojump
|