From 69541209dc9297c7ca14e5fc2a88c2763926be8a Mon Sep 17 00:00:00 2001 From: "Oliver Surke (Gitea)" Date: Mon, 11 May 2026 15:42:20 +0200 Subject: [PATCH] Fix ssr::confirm using bash 4+ lowercase operator on bash 3.2 macOS ships /bin/bash 3.2.57 which has no `${var,,}` parameter expansion. Replace with a portable case statement matching y/Y. Behaviorally identical (read -n 1 already constrains input to a single char, and the original code only accepted 'y' after lowercasing, so 'y' and 'Y' are the only accepting inputs). Repo-wide audit for other bash 4+ features (case modification, mapfile, nameref locals, ${var@op} transforms, coproc) returned clean. Repro before fix: $ ./install.sh Enable daily scheduled sync (launchd)? [y/N]: y lib/common.sh: line 52: ${reply,,}: bad substitution Co-authored-by: Cursor --- lib/common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.sh b/lib/common.sh index 2e51504..1fff511 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -49,7 +49,7 @@ ssr::confirm() { read -r -n 1 -p "${prompt} [y/N]: " reply || reply="" fi echo - [[ "${reply,,}" == "y" ]] + case "$reply" in y|Y) return 0 ;; *) return 1 ;; esac } # Validate a path is safe (no newlines, no `..` traversal). Used before any FS op.