define GIT_STATUS as either 'clean' or 'modified'

This commit is contained in:
2024-09-13 18:25:35 -05:00
committed by Celtic Minstrel
parent fed420d1f5
commit 2b718f080d
2 changed files with 6 additions and 1 deletions

View File

@@ -6,5 +6,6 @@
REVID=`git rev-parse HEAD`;
export FULLTAG=`git tag --sort=v:refname | tail -n1`;
TAGREV=`git rev-parse $FULLTAG`;
STATUS=`git diff-index --quiet HEAD -- && echo "clean" || echo "modified"`;
echo -e "\n#define GIT_REVISION \"${REVID:0:7}\"\n#define GIT_TAG \"$FULLTAG\"\n#define GIT_TAG_REVISION \"${TAGREV:0:7}\"\n" > "$1/tools/gitrev.hpp"
echo -e "\n#define GIT_REVISION \"${REVID:0:7}\"\n#define GIT_TAG \"$FULLTAG\"\n#define GIT_TAG_REVISION \"${TAGREV:0:7}\"\n#define GIT_STATUS \"${STATUS}\"\n" > "$1/tools/gitrev.hpp"