feat: bootstrap.sh wraps the first command; the URL stays an argument
This commit is contained in:
@@ -1095,6 +1095,19 @@ else
|
||||
printf ' \033[33mskip\033[0m needs python3 to open a pty\n'
|
||||
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"
|
||||
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
|
||||
out=$(sh ./listen-test.sh 2>/dev/null | tr -d '\r' || true)
|
||||
|
||||
Reference in New Issue
Block a user