summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-16 18:57:10 +0100
committerCarl Hetherington <cth@carlh.net>2022-01-16 21:05:55 +0100
commit30b0f5b86022753c828bd455306c5e50ca14c5b3 (patch)
treedb96f093f3db3b83466954e34ff239192797370f
parent83caae94bccc7261e75421942c2a5b5b44537c9f (diff)
Fix versioning of .dmg filenames.
Now we use a tag if there is one at the commit we built, otherwise <branch>-<commit>.
-rw-r--r--platform/osx/make_dmg.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/platform/osx/make_dmg.sh b/platform/osx/make_dmg.sh
index 3df5c57a2..ba0f060ed 100644
--- a/platform/osx/make_dmg.sh
+++ b/platform/osx/make_dmg.sh
@@ -7,7 +7,12 @@ SYNTAX="make_dmg.sh <environment> <builddir> <apple-id> <apple-password> <arch1>
# Don't set -e here as egrep (used a few times) returns 1 if no matches
# were found.
-version=`git describe --tags --abbrev=0 | sed -e "s/v//"`
+# Use a tag if what we've built is exactly on one
+version=$(git describe --tags --abbrev=0 --match=v2.*.* --exact-match $1 2> /dev/null)
+if [ "$?" != "0" ]; then
+ # Otherwise use <branch>-<commit>
+ version="$(git rev-parse --abbrev-ref HEAD)-$(git rev-parse --short HEAD)"
+fi
# DMG size in megabytes
DMG_SIZE=256