Skip to content

Commit

Permalink
Fix incrementation of alpha, beta and rc preversion variable in cas…
Browse files Browse the repository at this point in the history
…es if there are `pre` already.
  • Loading branch information
Fedor Gubarev committed Jun 26, 2020
1 parent 721021b commit 2e460ae
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 2e460ae

Please sign in to comment.