Skip to content

Commit b93a3d8

Browse files
authored
fix(scripts): use portable lowercase in normalize_bool for Bash 3.2 (#1493)
1 parent c143c81 commit b93a3d8

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

tasks/scripts/gateway-vm.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ normalize_arch() {
5858
}
5959

6060
normalize_bool() {
61-
case "${1,,}" in
61+
local val
62+
val="$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')"
63+
case "${val}" in
6264
1|true|yes|on) echo "true" ;;
6365
0|false|no|off) echo "false" ;;
6466
*)

tasks/scripts/package-snap.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ infer_snap_arch() {
5959
}
6060

6161
normalize_bool() {
62-
case "${1,,}" in
62+
local val
63+
val="$(printf '%s' "$1" | tr '[:upper:]' '[:lower:]')"
64+
case "${val}" in
6365
1 | true | yes | on) echo "1" ;;
6466
0 | false | no | off) echo "0" ;;
6567
*)

0 commit comments

Comments
 (0)