1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

Update git revision script.

This commit is contained in:
Dave Davenport 2016-04-10 13:22:49 +02:00
parent a69754abff
commit 93362d63f2

View file

@ -2,18 +2,19 @@
DIR=$1
FILE=$2
GIT=$(which git)
if [ -d "${DIR}/.git/" ]
if [ -d "${DIR}/.git/" ] && [ -n "${GIT}" ]
then
echo -n "#define GIT_VERSION \"" > ${FILE}.tmp
REV="$(git describe --tags --always --dirty) ($(git describe --tags --always --all | sed -e 's:heads/::'))"
REV="$(${GIT} describe --tags --always --dirty) ($(${GIT} describe --tags --always --all | sed -e 's:heads/::'))"
echo -n "${REV}" >> ${FILE}.tmp
echo "\"" >> ${FILE}.tmp
else
echo "#undef GIT_VERSION" > ${FILE}.tmp
fi
if ! diff ${FILE}.tmp ${FILE} > /dev/null
if [ ! -f ${FILE} ] || ! diff ${FILE}.tmp ${FILE} > /dev/null
then
mv ${FILE}.tmp ${FILE}
else