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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LQJBvqzXeyuhhAcAA3Q5Wq
This commit is contained in:
+1
-3
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user