5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-09 16:20:26 +00:00

More tweaks to semver

This commit is contained in:
Neil Alexander 2018-12-18 12:14:47 +00:00
parent 3ea33c9fa7
commit 09ea9a166f
No known key found for this signature in database
GPG Key ID: A02A2019A2BB0944

View File

@ -52,8 +52,8 @@ else
fi
# Get the number of merges on the current branch since the last tag
TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" 2>/dev/null)
BUILD=$(git rev-list $TAG..$BRANCH --count)
TAG=$(git describe --abbrev=0 --tags --match="v[0-9]*\.[0-9]*\.[0-9]*" --first-parent master 2>/dev/null)
BUILD=$(git rev-list $TAG.. --count)
# Add the build tag on non-master branches
if [ $BRANCH != "master" ]; then
@ -62,6 +62,6 @@ if [ $BRANCH != "master" ]; then
fi
else
if [ $BUILD != 0 ]; then
printf -- "-%d" "$BUILD"
printf -- "-%d" "$(($BUILD+1))"
fi
fi