fix(install): Improve interactive terminal detection and update installation instructions
This commit is contained in:
13
install.sh
13
install.sh
@@ -60,8 +60,8 @@ fi
|
||||
if [ ! -t 0 ] || [ ! -t 1 ]; then
|
||||
# Either stdin or stdout is not a terminal, check if -y was provided
|
||||
if [ $AUTO_YES -ne 1 ]; then
|
||||
echo "Warning: Running in non-interactive mode without -y flag."
|
||||
echo "Will ask for confirmation via controlling terminal."
|
||||
echo "Script detected it's running in a non-interactive environment without -y flag."
|
||||
echo "Attempting to find a controlling terminal for interactive prompts..."
|
||||
# Try to use a controlling terminal for user input
|
||||
if [ -t 1 ]; then
|
||||
# Stdout is a terminal, use it
|
||||
@@ -72,9 +72,14 @@ if [ ! -t 0 ] || [ ! -t 1 ]; then
|
||||
fi
|
||||
|
||||
if [ $INTERACTIVE -eq 0 ]; then
|
||||
echo "No controlling terminal available. To run non-interactively, use:"
|
||||
echo " curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh | sudo bash -s -- -y"
|
||||
echo "ERROR: No controlling terminal available for interactive prompts."
|
||||
echo "For interactive installation (RECOMMENDED):"
|
||||
echo " sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh)"
|
||||
echo "For non-interactive installation with automatic dependency installation:"
|
||||
echo " sudo bash <(curl -sSL https://code.foss.global/serve.zone/nupst/raw/branch/main/install.sh) -y"
|
||||
exit 1
|
||||
else
|
||||
echo "Interactive terminal found, continuing with prompts..."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
Reference in New Issue
Block a user