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.
This commit is contained in:
parent
5fa4bb9777
commit
f04c9f38da
1 changed files with 6 additions and 1 deletions
|
|
@ -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/"
|
||||
|
|
|
|||
Loading…
Reference in a new issue