From d222f7c7d2862d0eef4f2414f0ff95718aeac212 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Wed, 24 Nov 2021 21:49:36 -0300 Subject: [PATCH] Build script: Add + specifier to git hash if the tree is dirty --- .ci/build.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.ci/build.sh b/.ci/build.sh index a73d3f6c8..ad3fa279c 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -297,7 +297,13 @@ esac # Add git hash and copyright year. git_hash=$(git rev-parse --short HEAD 2> /dev/null) -[ -z "$git_hash" -a "$CI" = "true" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8) +if [ "$CI" = "true" ] +then + [ -z "$git_hash" ] && git_hash=$(echo $GIT_COMMIT | cut -c 1-8) +elif [ ! -z "$git_hash" ] +then + git diff --quiet 2> /dev/null || git_hash="$git_hash+" +fi [ ! -z "$git_hash" ] && cmake_flags_extra="$cmake_flags_extra -D \"EMU_GIT_HASH=$git_hash\"" cmake_flags_extra="$cmake_flags_extra -D \"EMU_COPYRIGHT_YEAR=$(date +%Y)\""