Skip to content

Commit

Permalink
Ensure the bump-version script can bump prereleases
Browse files Browse the repository at this point in the history
Currently there is a bug in the script's logic that prevents you from
running `./bump-version prerelease` to bump _just_ the prerelease. This
is due to faulty checking logic to ensure expected behavior when
combining bump commands.
  • Loading branch information
mcdonnnj committed Jan 6, 2025
1 parent 82a9528 commit 96279e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bump-version
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ if [ -n "$label" ] && [ "$with_prerelease" = false ] && [[ ! " ${commands_with_l
invalid_option "Setting the label is only allowed for the following commands: ${commands_with_label[*]}"
fi

if [ "$with_prerelease" = true ] && [[ ! " ${commands_with_prerelease[*]} " =~ [[:space:]]${bump_part}[[:space:]] ]]; then
if [ "$with_prerelease" = true ] && [ -n "$bump_part" ] && [[ ! " ${commands_with_prerelease[*]} " =~ [[:space:]]${bump_part}[[:space:]] ]]; then
invalid_option "Changing the prerelease is only allowed in conjunction with the following commands: ${commands_with_prerelease[*]}"
fi

Expand Down

0 comments on commit 96279e8

Please sign in to comment.