Skip to content

Commit 61ab5ae

Browse files
authored
Fix string comparison in bump-version script (#1638)
The validation on line 9 used (( )) arithmetic context for string comparison, which always errors. Replace with [[ ]] for proper string matching and add || usage to actually reject invalid inputs.
1 parent 5fcf281 commit 61ab5ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

script/bump-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ while getopts "p:" o; do
66
case "${o}" in
77
p)
88
patch_level=${OPTARG}
9-
(( patch_level == 'major' || patch_level == 'minor' || patch_level == 'patch'))
9+
[[ "${patch_level}" == 'major' || "${patch_level}" == 'minor' || "${patch_level}" == 'patch' ]] || usage
1010
;;
1111
*)
1212
usage

0 commit comments

Comments
 (0)