Skip to content

Commit 41decc5

Browse files
committed
Fix releaseit to not be case-sensitive
1 parent 71af5c5 commit 41decc5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

bin/releaseit

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ INCREMENT=${1:-PATCH}
66

77
increment_version() {
88
local version=$1
9-
local part=$2
9+
local part=$(echo "$2" | tr '[:lower:]' '[:upper:]')
1010
IFS='.' read -ra VERSION_PARTS <<< "$version"
1111
case "$part" in
1212
MAJOR)
@@ -21,12 +21,16 @@ increment_version() {
2121
PATCH)
2222
VERSION_PARTS[2]=$((VERSION_PARTS[2]+1))
2323
;;
24+
*)
25+
echo "Error: Invalid version increment part '$2'. Use MAJOR, MINOR, or PATCH." >&2
26+
exit 1
27+
;;
2428
esac
2529
echo "${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}"
2630
}
2731

2832
current_version=$(yq e '.env.VERSION' .pkgx.yaml)
29-
new_version=$(increment_version $current_version $INCREMENT)
33+
new_version=$(increment_version "$current_version" "$INCREMENT")
3034
yq e -i ".env.VERSION = \"$new_version\"" .pkgx.yaml
3135
git add .pkgx.yaml
3236
git commit -m "Release v$new_version"

0 commit comments

Comments
 (0)