edits to genbuild.sh

This commit is contained in:
jahway603
2022-09-03 09:56:55 -04:00
parent 1085d15a2d
commit 7fc594d220

View File

@@ -15,7 +15,6 @@ fi
DESC=""
SUFFIX=""
LAST_COMMIT_DATE=""
if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
# clean 'dirty' status of touched files that haven't been modified
git diff >/dev/null 2>/dev/null
@@ -30,8 +29,6 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/
SUFFIX=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
# get a string like "2012-04-10 16:27:19 +0200"
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
fi
if [ -n "$DESC" ]; then
@@ -45,7 +42,4 @@ fi
# only update build.h if necessary
if [ "$INFO" != "$NEWINFO" ]; then
echo "$NEWINFO" >"$FILE"
if [ -n "$LAST_COMMIT_DATE" ]; then
echo "#define BUILD_DATE \"$LAST_COMMIT_DATE\"" >> "$FILE"
fi
fi