280
export TEST_COMPOSIO_LOG="$composio_log"
281
282
reset_case() {
283
- unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
283
+ unset CASE_GITHUB_URL CASE_API_BASE CASE_INSTALL_VERSION CASE_INSTALL_SHELL CASE_PLUGINS CASE_QUIET CASE_DEBUG CASE_HELP
284
unset CASE_ALLOW_HTTP_HOST CASE_CHECKSUM_MODE CASE_API_ASSET_URL CASE_BASE_MODE CASE_REDIRECT_DOWNGRADE
285
unset CASE_SHELL_CAPABILITY CASE_INSTALL_EXIT CASE_SETUP_EXIT CASE_VERSION_EXIT CASE_PATH_PREFIX CASE_UNSET_SHELL
286
unset CASE_CURL_DELAY_URL CASE_CURL_DELAY_SECONDS
306
COMPOSIO_INSTALL_DIR="$install_dir" \
307
COMPOSIO_BIN_DIR="$bin_dir" \
308
COMPOSIO_INSTALL_VERSION="${CASE_INSTALL_VERSION:-}" \
309
+ COMPOSIO_INSTALL_SHELL="${CASE_INSTALL_SHELL:-}" \
310
COMPOSIO_INSTALL_PLUGINS="${CASE_PLUGINS:-0}" \
311
COMPOSIO_QUIET="${CASE_QUIET:-0}" \
312
COMPOSIO_DEBUG="${CASE_DEBUG:-0}" \
543
done
544
545
reset_case
546
+ CASE_INSTALL_SHELL=zsh
547
direct_home="$case_root/direct-shell-home"
548
direct_bin="$case_root/direct-shell-bin"
547
- direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" --shell zsh 2>&1)
548
- grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name --shell delegation"
549
- assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name --shell confirmation"
550
- assert_not_contains "$direct_output" 'Required next step' "$interpreter_name --shell must not print setup guidance"
551
- [[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name --shell CLI path must not write rc files"
549
+ direct_output=$(run_installer "$direct_home" "$case_root/direct-shell-install" "$direct_bin" "$stable_tag" 2>&1)
550
+ grep -Fq "|installer|$direct_bin|install --shell zsh" "$composio_log" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL delegation"
551
+ assert_contains "$direct_output" 'Configured zsh shell setup (cli).' "$interpreter_name COMPOSIO_INSTALL_SHELL confirmation"
552
+ assert_not_contains "$direct_output" 'Required next step' "$interpreter_name COMPOSIO_INSTALL_SHELL must not print setup guidance"
553
+ [[ ! -e "$direct_home/.zshrc" ]] || fail "$interpreter_name COMPOSIO_INSTALL_SHELL CLI path must not write rc files"
554
555
reset_case
556
+ CASE_INSTALL_SHELL=zsh
557
CASE_SHELL_CAPABILITY=unsupported
558
direct_fallback_home="$case_root/direct-fallback-home"
556
- direct_fallback_output=$(run_installer "$direct_fallback_home" "$case_root/direct-fallback-install" "$case_root/direct-fallback-bin" "$stable_tag" --shell zsh 2>&1)
557
- grep -Fqx '# Composio CLI' "$direct_fallback_home/.zshrc" || fail "$interpreter_name --shell unsupported CLI fallback"
558
- assert_contains "$direct_fallback_output" 'Configured zsh shell setup (fallback).' "$interpreter_name --shell fallback confirmation"
559
+ direct_fallback_output=$(run_installer "$direct_fallback_home" "$case_root/direct-fallback-install" "$case_root/direct-fallback-bin" "$stable_tag" 2>&1)
560
+ grep -Fqx '# Composio CLI' "$direct_fallback_home/.zshrc" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL unsupported CLI fallback"
561
+ assert_contains "$direct_fallback_output" 'Configured zsh shell setup (fallback).' "$interpreter_name COMPOSIO_INSTALL_SHELL fallback confirmation"
562
563
reset_case
564
+ CASE_INSTALL_SHELL=fish
565
CASE_INSTALL_EXIT=23
566
direct_failed_home="$case_root/direct-failed-home"
563
- run_installer "$direct_failed_home" "$case_root/direct-failed-install" "$case_root/direct-failed-bin" "$stable_tag" --shell fish >/dev/null 2>&1
564
- grep -Fqx '# Composio CLI' "$direct_failed_home/.config/fish/config.fish" || fail "$interpreter_name --shell failed delegation fallback"
567
+ run_installer "$direct_failed_home" "$case_root/direct-failed-install" "$case_root/direct-failed-bin" "$stable_tag" >/dev/null 2>&1
568
+ grep -Fqx '# Composio CLI' "$direct_failed_home/.config/fish/config.fish" || fail "$interpreter_name COMPOSIO_INSTALL_SHELL failed delegation fallback"
569
570
reset_case
567
- if missing_shell_output=$(run_installer "$case_root/missing-shell-home" "$case_root/missing-shell-install" "$case_root/missing-shell-bin" --shell 2>&1); then
568
- fail "$interpreter_name --shell without a value must fail"
571
+ CASE_INSTALL_SHELL=tcsh
572
+ if invalid_shell_output=$(run_installer "$case_root/invalid-shell-home" "$case_root/invalid-shell-install" "$case_root/invalid-shell-bin" 2>&1); then
573
+ fail "$interpreter_name invalid COMPOSIO_INSTALL_SHELL must fail"
574
fi
570
- assert_contains "$missing_shell_output" '--shell requires a value' "$interpreter_name --shell missing value"
571
- [[ ! -s "$curl_log" ]] || fail "$interpreter_name --shell missing value must fail before network"
572
-
573
- reset_case
574
- if invalid_shell_output=$(run_installer "$case_root/invalid-shell-home" "$case_root/invalid-shell-install" "$case_root/invalid-shell-bin" --shell tcsh 2>&1); then
575
- fail "$interpreter_name invalid --shell value must fail"
576
- fi
577
- assert_contains "$invalid_shell_output" 'Invalid --shell value' "$interpreter_name invalid --shell message"
578
- [[ ! -s "$curl_log" ]] || fail "$interpreter_name invalid --shell must fail before network"
575
+ assert_contains "$invalid_shell_output" 'COMPOSIO_INSTALL_SHELL must be zsh, bash, or fish' "$interpreter_name invalid COMPOSIO_INSTALL_SHELL message"
576
+ [[ ! -s "$curl_log" ]] || fail "$interpreter_name invalid COMPOSIO_INSTALL_SHELL must fail before network"
577
578
reset_case
579
CASE_SHELL_CAPABILITY=unsupported