From 532e17ce0172962fb60dba9743084925feb21f6a Mon Sep 17 00:00:00 2001 From: darrenhinde <107584450+darrenhinde@users.noreply.github.com> Date: Tue, 18 Nov 2025 14:24:27 +0000 Subject: [PATCH] fix: auto-install when profile specified via command line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - Running 'curl ... | bash -s core' showed preview and waited for input - User had to press Y to proceed even though profile was specified - Defeats the purpose of one-command installation Solution: - Add NON_INTERACTIVE flag to track command-line profile usage - Set NON_INTERACTIVE=true when profile argument provided - Skip confirmation prompt when NON_INTERACTIVE=true - Show 'Installing automatically (profile specified)...' message Behavior: Before: curl ... | bash -s core → Shows preview, waits for Y/n input After: curl ... | bash -s core → Shows preview, installs automatically Interactive mode still works: bash install.sh → Shows menu, asks for confirmation (as expected) This makes profile-based installation truly one-command with no interaction needed. --- install.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/install.sh b/install.sh index 3d8ec10..3608212 100755 --- a/install.sh +++ b/install.sh @@ -55,6 +55,7 @@ TEMP_DIR="/tmp/opencode-installer-$$" SELECTED_COMPONENTS=() INSTALL_MODE="" PROFILE="" +NON_INTERACTIVE=false ############################################################################# # Utility Functions @@ -498,14 +499,21 @@ show_installation_preview() { [ ${#configs[@]} -gt 0 ] && echo -e "${CYAN}Config (${#configs[@]}):${NC} ${configs[*]##*:}" echo "" - read -p "Proceed with installation? [Y/n]: " confirm - if [[ $confirm =~ ^[Nn] ]]; then - print_info "Installation cancelled" - cleanup_and_exit 0 + # Skip confirmation if profile was provided via command line + if [ "$NON_INTERACTIVE" = true ]; then + print_info "Installing automatically (profile specified)..." + perform_installation + else + read -p "Proceed with installation? [Y/n]: " confirm + + if [[ $confirm =~ ^[Nn] ]]; then + print_info "Installation cancelled" + cleanup_and_exit 0 + fi + + perform_installation fi - - perform_installation } ############################################################################# @@ -808,18 +816,22 @@ main() { core|--core) INSTALL_MODE="profile" PROFILE="core" + NON_INTERACTIVE=true ;; developer|--developer) INSTALL_MODE="profile" PROFILE="developer" + NON_INTERACTIVE=true ;; full|--full) INSTALL_MODE="profile" PROFILE="full" + NON_INTERACTIVE=true ;; advanced|--advanced) INSTALL_MODE="profile" PROFILE="advanced" + NON_INTERACTIVE=true ;; list|--list) check_dependencies