Skip to content

Commit

Permalink
fixes #12
Browse files Browse the repository at this point in the history
  • Loading branch information
MateusGabi committed Apr 20, 2018
1 parent 5bec9bf commit 0796d5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/semver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0796d5d

Please sign in to comment.