aboutsummaryrefslogtreecommitdiff
path: root/bin/build-all.sh
diff options
context:
space:
mode:
authorSelene ToyKeeper2023-12-02 13:30:42 -0700
committerSelene ToyKeeper2023-12-02 13:30:42 -0700
commitdcbacb61bb3e04872927008a394524ed9208c740 (patch)
treecc7e4733336426726e8e09ba6e1134a4a644ca34 /bin/build-all.sh
parentrun CI on all branches, not just on trunk (diff)
downloadanduril-dcbacb61bb3e04872927008a394524ed9208c740.tar.gz
anduril-dcbacb61bb3e04872927008a394524ed9208c740.tar.bz2
anduril-dcbacb61bb3e04872927008a394524ed9208c740.zip
build-all: handle the case where "git describe" can't get any tags
Resulting revision is "$MODEL-0.$HASH" where the hash is the commit short ID
Diffstat (limited to '')
-rwxr-xr-xbin/build-all.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/build-all.sh b/bin/build-all.sh
index 444809e..f239217 100755
--- a/bin/build-all.sh
+++ b/bin/build-all.sh
@@ -88,6 +88,11 @@ function make-version-h {
# strip rev hash (git won't give "commits since tag" without the rev hash)
REV="${REV/-g[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/}"
REV="${REV/-dirty/.1}" # convert '-dirty' to '.1'
+ # handle an empty name (happens during github action runs)
+ if [[ -z "$REV" ]]; then
+ HASH=$(git describe --always)
+ REV="0.$HASH"
+ fi
# save the version name to version.h
mkdir -p ".build/$UI"
echo '#define VERSION_NUMBER "'"$REV"'"' > ".build/$UI/version.h"