Skip to content

Commit 59c6cfc

Browse files
committed
Ensure the bump-version script can bump prereleases
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.
1 parent 0d48ebd commit 59c6cfc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bump-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ if [ -n "$label" ] && [ "$with_prerelease" = false ] && [[ ! " ${commands_with_l
125125
invalid_option "Setting the label is only allowed for the following commands: ${commands_with_label[*]}"
126126
fi
127127

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

0 commit comments

Comments
 (0)