From 4d86231c9ae4e7a62abf57fe8b0cf2789ace8129 Mon Sep 17 00:00:00 2001 From: Pulse Monitor Date: Sun, 24 Aug 2025 15:27:10 +0000 Subject: [PATCH] debug: add debug output to diagnose menu selection issue Temporarily adding debug output to understand why menu selections aren't working when the script is piped through curl. --- install.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index bad91b0fa..0a622dd5f 100755 --- a/install.sh +++ b/install.sh @@ -41,19 +41,18 @@ print_header() { safe_read() { local prompt="$1" local var_name="$2" - shift 2 - local read_args="$@" # When script is piped (curl | bash), stdin is the pipe, not the terminal # We need to read from /dev/tty for user input if [[ -e /dev/tty ]]; then # TTY is available, read from it echo -n "$prompt" > /dev/tty - IFS= read -r $read_args $var_name < /dev/tty + # Use read with -u to read from file descriptor + IFS= read -r "$var_name" < /dev/tty else # No TTY (e.g., in automated environments) echo -n "$prompt" - IFS= read -r $read_args $var_name + IFS= read -r "$var_name" fi } @@ -958,6 +957,9 @@ main() { exit 1 fi + # Debug output to see what's happening + print_info "DEBUG: You selected option $choice" + # Determine what action to take based on the dynamic menu local action="" local target_version="" @@ -1000,6 +1002,9 @@ main() { action="cancel" fi + # Debug: Show what action was determined + print_info "DEBUG: Action determined: ${action:-'none'}" + case $action in update) # Determine if this is an upgrade or downgrade