From 0796d5d052df7927ea04bb62494d6c0751f874e1 Mon Sep 17 00:00:00 2001 From: Mateus Gabi Date: Fri, 20 Apr 2018 15:41:15 +0000 Subject: [PATCH] fixes #12 --- src/semver.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/semver.sh b/src/semver.sh index f262c3c..339ad92 100644 --- a/src/semver.sh +++ b/src/semver.sh @@ -76,7 +76,7 @@ print "Last Tag Hash: $LAST_COMMIT_HASH_WITH_TAG" ## ## Avoiding duplicate tags on same commits -if [[ "$LAST_COMMIT_HASH" = "$LAST_COMMIT_HASH_WITH_TAG" ]]; then +if [[ "$LAST_COMMIT_HASH" = "$LAST_COMMIT_HASH_WITH_TAG" && "$GENERATE" ]]; then echo "You cannot tag one commit with two version" exit 1 fi @@ -100,6 +100,10 @@ else export LATEST_MINOR_VERSION=$x print "LATEST_MINOR_VERSION: $x" elif [[ "$i" = 3 ]]; then + x="$x-+" + x=$(echo "$x" | grep -oP "[0-9]*(-|\+)" | head -1) + x=${x//-} + x=${x//+} export LATEST_PATCH_VERSION=$x print "LATEST_PATCH_VERSION: $x" fi