feat: bootstrap.sh defaults to its own clone URL — one URL to type
This commit is contained in:
+9
-8
@@ -1098,15 +1098,16 @@ fi
|
||||
printf '\n\033[1mbootstrap.sh — the first command, wrapped\033[0m\n'
|
||||
B=$ROOT/bootstrap.sh
|
||||
if sh -n "$B" 2>/dev/null; then ok "bootstrap.sh parses"; else no "bootstrap.sh has a syntax error"; fi
|
||||
# The same property the phase 3 negative test asserts for the tier as a whole:
|
||||
# this file ships in the public repo, so it names no real host, ever.
|
||||
if grep -qEi 'djdadi|15\.204|xeta' "$B"; then no "bootstrap.sh names a real host"; else ok "bootstrap.sh names no real host"; fi
|
||||
# No URL from argv, env, or a tty -> usage and exit 2, before curl runs.
|
||||
rc=0; out=$(DOTFILES_URL= sh "$B" </dev/null 2>&1) || rc=$?
|
||||
is "no URL anywhere is refused, not guessed" 2 "$rc"
|
||||
# The tier names no real host, with one carved-out exception: this file may
|
||||
# name ITS OWN clone URL (fetching it proves you know the host already). It
|
||||
# must never name the endpoint, the VPS, or the private repo.
|
||||
if grep -qEi 'xeta|15\.204|dotfiles-private' "$B"; then no "bootstrap.sh names a host beyond its own repo"; else ok "bootstrap.sh names nothing beyond its own repo"; fi
|
||||
if grep -q 'DEFAULT_URL="https://[^"]*/dotfiles-public.git"' "$B"; then ok "…and defaults to its own clone URL"; else no "…and defaults to its own clone URL — default missing or malformed"; fi
|
||||
# An explicit empty URL is an error, not a fall-through to the default: the
|
||||
# caller said "this one" and named nothing.
|
||||
rc=0; out=$(DOTFILES_URL= sh "$B" "" </dev/null 2>&1) || rc=$?
|
||||
is "an explicit empty URL is refused, not defaulted" 2 "$rc"
|
||||
has "…and says how to call it" "usage:" "$out"
|
||||
rc=0; out=$(sh "$B" "" </dev/null 2>&1) || rc=$?
|
||||
is "an empty argument is an error too, not a prompt hang" 2 "$rc"
|
||||
|
||||
printf '\n\033[1minteractive loop (needs a pty)\033[0m\n'
|
||||
if command -v fzf >/dev/null && command -v curl >/dev/null && command -v script >/dev/null; then
|
||||
|
||||
Reference in New Issue
Block a user