File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ INCREMENT=${1:-PATCH}
6
6
7
7
increment_version () {
8
8
local version=$1
9
- local part=$2
9
+ local part=$( echo " $2 " | tr ' [:lower:] ' ' [:upper:] ' )
10
10
IFS=' .' read -ra VERSION_PARTS <<< " $version"
11
11
case " $part " in
12
12
MAJOR)
@@ -21,12 +21,16 @@ increment_version() {
21
21
PATCH)
22
22
VERSION_PARTS[2]=$(( VERSION_PARTS[2 ]+ 1 ))
23
23
;;
24
+ * )
25
+ echo " Error: Invalid version increment part '$2 '. Use MAJOR, MINOR, or PATCH." >&2
26
+ exit 1
27
+ ;;
24
28
esac
25
29
echo " ${VERSION_PARTS[0]} .${VERSION_PARTS[1]} .${VERSION_PARTS[2]} "
26
30
}
27
31
28
32
current_version=$( yq e ' .env.VERSION' .pkgx.yaml)
29
- new_version=$( increment_version $current_version $INCREMENT )
33
+ new_version=$( increment_version " $current_version " " $INCREMENT " )
30
34
yq e -i " .env.VERSION = \" $new_version \" " .pkgx.yaml
31
35
git add .pkgx.yaml
32
36
git commit -m " Release v$new_version "
You can’t perform that action at this time.
0 commit comments