From f04c9f38da1e303acdbba427746bac6690c4f8b9 Mon Sep 17 00:00:00 2001 From: Parfii-bot Date: Tue, 21 Apr 2026 03:48:28 +0800 Subject: [PATCH] fix(install): replace compgen with bash-3.2-portable glob check compgen is unreliable on bash 3.2 (macOS stock). Replace with a simple for-loop over the glob plus a file-existence test that breaks early. --- install.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 6b0eec1..fdf4d4d 100755 --- a/install.sh +++ b/install.sh @@ -197,7 +197,12 @@ done say " copied $copied, skipped $skipped (already present)" # --- copy template --------------------------------------------------------- -if compgen -G "$KIT_DIR/_templates/*.template" >/dev/null; then +# bash-3.2-portable glob detection: iterate, break on first hit. +has_templates=0 +for t in "$KIT_DIR/_templates/"*.template; do + [ -f "$t" ] && { has_templates=1; break; } +done +if [ "$has_templates" = "1" ]; then say "copying specialist template" backup_dir "$AGENTS_DIR/_templates" cp -f "$KIT_DIR/_templates/"*.template "$AGENTS_DIR/_templates/"