From 5954cdb98479287daa37526723229027dedb25fb Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Jun 2026 12:07:07 +0000 Subject: [PATCH] bootstrap.sh: replace BASH_SOURCE with $0 to fix pipe execution BASH_SOURCE[0] is unbound when bash reads from a pipe; set -u turns this into a fatal error that no amount of :- or set +u reliably fixes across bash versions. $0 is always set: 'bash' when piped (dirname gives '.' where no setup.sh exists), and the correct path when run directly. Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_01LQJBvqzXeyuhhAcAA3Q5Wq --- bootstrap.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 50fa374..8ffcf08 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -48,9 +48,7 @@ echo "" # ── Option 3: already running from inside the repo ─────────────────────────── # If setup.sh is sitting next to this script, we have everything we need. -set +u -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-}")" 2>/dev/null && pwd || echo "")" -set -u +SCRIPT_DIR="$(cd "$(dirname "$0")" 2>/dev/null && pwd || echo "")" if [ -f "${SCRIPT_DIR}/setup.sh" ]; then echo " Running from local copy at $SCRIPT_DIR" echo " (No git or internet needed)"