Skip to content

Commit ebf791d

Browse files
committed
fix(install.sh): improve non-interactive mode handling for upgrades
- Exit with instructions when in non-interactive mode instead of auto-proceeding. - Provide usage instructions for upgrading in non-interactive mode.
1 parent fbc1810 commit ebf791d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

scripts/install.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,15 +278,20 @@ if command_exists pingu; then
278278
else
279279
printf "Do you want to reinstall/upgrade? [y/N] "
280280

281-
# Handle non-interactive mode (when piped)
281+
# Read user response
282282
if [ -t 0 ]; then
283-
# Interactive mode - read from terminal
283+
# Terminal is available, read normally
284284
read -r response
285285
else
286-
# Non-interactive mode - assume yes for upgrades
287-
echo "y"
288-
echo_e "${INFO} Non-interactive mode detected. Auto-proceeding with upgrade..."
289-
response="y"
286+
# No terminal (piped), exit with instructions
287+
echo ""
288+
echo_e "${INFO} Non-interactive mode detected."
289+
echo_e "${INFO} To upgrade in non-interactive mode, use:"
290+
echo_e ""
291+
echo_e " ${CYAN}curl -fsSL ... | sh -s -- --force${NC}"
292+
echo_e ""
293+
echo_e "${INFO} Installation cancelled"
294+
exit 0
290295
fi
291296

292297
case "$response" in

0 commit comments

Comments
 (0)