From 0061dca950c5f7f1739ece5d6850f611b75468cb Mon Sep 17 00:00:00 2001 From: Teknium Date: Thu, 16 Apr 2026 20:13:04 -0700 Subject: [PATCH] fix(installer): make prompt_yes_no bash 3.2 compatible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The helper used ${var,,} (bash 4+ lowercase parameter expansion) and [[ =~ ]], which fail on macOS default /bin/bash (3.2.57) with: bash: ${default,,}: bad substitution With 'set -e' at the top of the script, that aborts the whole installer for macOS users who don't have a newer bash on PATH. Replace the lowercase expansions with POSIX-style case patterns (`[yY]|[yY][eE][sS]|...`) that behave identically and parse cleanly on bash 3.2. Verified with a 15-case behavior test on both bash 3.2 and bash 5.2 — all pass. --- scripts/install.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 9eaa5c17e..0de5da908 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -128,8 +128,9 @@ prompt_yes_no() { local prompt_suffix local answer="" - case "${default,,}" in - y|yes|true|1) prompt_suffix="[Y/n]" ;; + # Use case patterns (not ${var,,}) so this works on bash 3.2 (macOS /bin/bash). + case "$default" in + [yY]|[yY][eE][sS]|[tT][rR][uU][eE]|1) prompt_suffix="[Y/n]" ;; *) prompt_suffix="[y/N]" ;; esac @@ -144,16 +145,18 @@ prompt_yes_no() { answer="${answer#"${answer%%[![:space:]]*}"}" answer="${answer%"${answer##*[![:space:]]}"}" - answer="${answer,,}" if [ -z "$answer" ]; then - case "${default,,}" in - y|yes|true|1) return 0 ;; + case "$default" in + [yY]|[yY][eE][sS]|[tT][rR][uU][eE]|1) return 0 ;; *) return 1 ;; esac fi - [[ "$answer" =~ ^y(es)?$ ]] + case "$answer" in + [yY]|[yY][eE][sS]) return 0 ;; + *) return 1 ;; + esac } is_termux() {