From 4c7943b9bb90a9ecda9e4a69a38ef89de665fd6d Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Fri, 28 Oct 2016 13:02:13 +0200 Subject: [PATCH] fix(build): Guess new version in bump.sh --- bump.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bump.sh b/bump.sh index eee0f155..c11a99c4 100755 --- a/bump.sh +++ b/bump.sh @@ -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)