1. msi version fix

This commit is contained in:
vadym 2021-09-13 13:05:31 +03:00
parent b5ee2aa023
commit 87344df8ee

View file

@ -17,30 +17,6 @@ if [ $? != 0 ] || [ -z "$BRANCH" ]; then
BRANCH="master" BRANCH="master"
fi fi
# Split out into major, minor and patch numbers STAG=$(echo $TAG | sed 's/v//')
MAJOR=$(echo $TAG | cut -c 2- | cut -d "." -f 1)
MINOR=$(echo $TAG | cut -c 2- | cut -d "." -f 2)
PATCH=$(echo $TAG | cut -c 2- | cut -d "." -f 3 | awk -F"rc" '{print $1}')
# Output in the desired format printf '%s' "$STAG"
if [ $((PATCH)) -eq 0 ]; then
printf '%s%d.%d' "$PREPEND" "$((MAJOR))" "$((MINOR))"
else
printf '%s%d.%d.%d' "$PREPEND" "$((MAJOR))" "$((MINOR))" "$((PATCH))"
fi
# Add the build tag on non-master branches
if [ "$BRANCH" != "master" ]; then
BUILD=$(git rev-list --count $TAG..HEAD 2>/dev/null)
# Did getting the count of commits since the tag succeed?
if [ $? != 0 ] || [ -z "$BUILD" ]; then
printf -- "-unknown"
exit 0
fi
# Is the build greater than zero?
if [ $((BUILD)) -gt 0 ]; then
printf -- "-%04d" "$((BUILD))"
fi
fi