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:
parent
a69754abff
commit
93362d63f2
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue