diff --git a/shell/install.sh b/shell/install.sh index 8ffdf864ac3..4eee4cb1791 100755 --- a/shell/install.sh +++ b/shell/install.sh @@ -186,6 +186,22 @@ usage() { echo "using '--fresh' or '--dev'" } +# Conditionally connect /dev/tty when +# the environment variable TTY is set to 1 +TTY="${TTY-0}" +R= +prompt() { + # expects to be called as prompt "Do you want to do this? [Y/n] " + printf "$1" + if [ "$TTY" = 1 ]; then + read R