From 6c2a5935220dd49fd50480bf6d2028625d654a2c Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 16 Mar 2026 05:32:20 +0000 Subject: [PATCH] Fix setup.sh crash on Mac with empty gitignore array The `set -u` (nounset) flag in setup.sh causes `${_HIDDEN_GITIGNORES[@]}` to fail with "unbound variable" when no parent .gitignore with `*` is found (common on Mac where the install is not inside a Python venv). Use the `${arr[@]+"${arr[@]}"}` idiom to safely expand empty arrays under nounset mode. --- studio/setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/setup.sh b/studio/setup.sh index 3fc01feb2b..9754473798 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -137,7 +137,7 @@ while [ "$_dir" != "/" ]; do done _restore_gitignores() { - for _gi in "${_HIDDEN_GITIGNORES[@]}"; do + for _gi in "${_HIDDEN_GITIGNORES[@]+"${_HIDDEN_GITIGNORES[@]}"}"; do mv "${_gi}._twbuild" "$_gi" 2>/dev/null || true done }