fix(build): Guess new version in bump.sh

This commit is contained in:
Michael Carlberg 2016-10-28 13:02:13 +02:00
parent a04bdb31f0
commit 4c7943b9bb
1 changed files with 7 additions and 3 deletions

10
bump.sh
View File

@ -1,9 +1,13 @@
#!/bin/sh
# Use passed argument as new tag
[ $# -eq 1 ] && {
git tag "$@" || exit 1
}
if [ $# -eq 0 ]; then
version=$(git describe --tags --abbrev=0)
patch=${version##*.}
set -- "${version%.*}.$((patch+1))"
fi
git tag "$@" || exit 1
# shellcheck disable=SC2016
tag_prev=$(git tag -l | tail -2 | head -1)