Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions e2e/installer.bats
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ run_post_install_setup() {
[[ "$output" != *"Basecamp CLI"* ]] # banner would print if main ran
}

@test "install.sh runs main when piped to bash" {
# Keep PATH empty so main stops at its curl prerequisite without downloading
# anything or modifying the test environment.
run bash -c "cat '$INSTALL_SH' | PATH='$BATS_TEST_TMPDIR' '$BASH'"
[[ "$status" -ne 0 ]]
[[ "$output" == *"curl is required but not installed"* ]]
[[ "$output" != *"BASH_SOURCE[0]: unbound variable"* ]]
}

@test "new binary: post_install_setup dispatches to 'setup agents', never 'setup claude'" {
run_post_install_setup
[[ "$status" -eq 0 ]]
Expand Down
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,6 @@ post_install_setup() {
# Guard so sourcing the script (e.g. from tests) doesn't run the installer.
# The if-form is required: `[[ … ]] && main` returns 1 when sourced, which
# trips `set -e` in the sourcing shell.
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
if [[ "${BASH_SOURCE[0]:-$0}" == "$0" ]]; then
main "$@"
fi