bootstrap.sh: fix BASH_SOURCE unbound variable when piped through bash
set -euo pipefail causes ${BASH_SOURCE[0]} to abort with 'unbound variable'
when the script is fed via curl | bash. Use ${BASH_SOURCE[0]:-} so the
variable expands to an empty string in that context, letting SCRIPT_DIR
resolve safely and the pipe path continue to the git-clone branch.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LQJBvqzXeyuhhAcAA3Q5Wq
This commit is contained in:
+1
-1
@@ -48,7 +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.
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd || echo "")"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[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