Skip to content

Commit

Permalink
Merge pull request #5 from DRITE/fix/incrementation-preversion
Browse files Browse the repository at this point in the history
Fix incrementation of alpha, beta and rc `preversion` variable in cases if there are `pre` already.
  • Loading branch information
christian-draeger authored Jul 12, 2020
2 parents 721021b + 2e460ae commit 9d04121
Showing 1 changed file with 27 additions and 18 deletions.
45 changes: 27 additions & 18 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,39 @@ main() {
"bug")
((++patch)); pre="";;
"alpha")
if [[ ! -z "$preversion" ]]; then
preversion=0
fi
((++preversion))
if [[ "$pre" != "-alpha" ]]; then
preversion=1
if [[ -z "$preversion" ]];
then
preversion=0
else
if [[ "$pre" != "-alpha" ]];
then
preversion=1
else ((++preversion))
fi
fi
pre="-alpha$preversion";;
"beta")
if [[ ! -z "$preversion" ]]; then
preversion=0
fi
((++preversion))
if [[ "$pre" != "-beta" ]]; then
preversion=1
if [[ -z "$preversion" ]];
then
preversion=0
else
if [[ "$pre" != "-beta" ]];
then
preversion=1
else ((++preversion))
fi
fi
pre="-beta$preversion";;
"rc")
if [[ ! -z "$preversion" ]]; then
preversion=0
fi
((++preversion))
if [[ "$pre" != "-rc" ]]; then
preversion=1
if [[ -z "$preversion" ]];
then
preversion=0
else
if [[ "$pre" != "-rc" ]];
then
preversion=1
else ((++preversion))
fi
fi
pre="-rc$preversion";;
esac
Expand Down

0 comments on commit 9d04121

Please sign in to comment.