mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-11-27 12:05:23 +00:00
Fix semver when git history is not present
This commit is contained in:
parent
4532d0e0c8
commit
d0c2ce90bb
@ -1,10 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Get the branch name, removing any "/" characters from pull requests
|
# Get the branch name, removing any "/" characters from pull requests
|
||||||
BRANCH=$(git symbolic-ref --short HEAD | tr -d "/" 2>/dev/null)
|
BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null | tr -d "/")
|
||||||
|
|
||||||
# Check if the branch name is not master
|
# Check if the branch name is not master
|
||||||
if [ "$BRANCH" = "master" ]; then
|
if [ "$BRANCH" = "master" ] || [ $? != 0 ]; then
|
||||||
printf "yggdrasil"
|
printf "yggdrasil"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
@ -16,6 +16,11 @@ PATCH=$(git rev-list $TAG..master --count --merges --grep="from $DEVELOPBRANCH"
|
|||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
PATCH=$(git rev-list HEAD --count 2>/dev/null)
|
PATCH=$(git rev-list HEAD --count 2>/dev/null)
|
||||||
|
|
||||||
|
if [ $? != 0 ]; then
|
||||||
|
printf 'unknown'
|
||||||
|
exit -1
|
||||||
|
fi
|
||||||
|
|
||||||
printf 'v0.0.%d' "$PATCH"
|
printf 'v0.0.%d' "$PATCH"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user