mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2025-04-29 22:55:06 +03:00
1. msi version fix
This commit is contained in:
parent
b5ee2aa023
commit
87344df8ee
1 changed files with 2 additions and 26 deletions
|
@ -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
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue