From 6dd85c2cb3082957f75f72b15d95bd1c92e4232e Mon Sep 17 00:00:00 2001 From: Sabine Schmaltz Date: Wed, 5 Apr 2023 18:13:58 +0200 Subject: [PATCH] conditionally connect /dev/tty only when environment var TTY=1 --- shell/install.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/shell/install.sh b/shell/install.sh index f848c17325a..75ac6a7b9d8 100755 --- a/shell/install.sh +++ b/shell/install.sh @@ -186,14 +186,22 @@ usage() { echo "using '--fresh' or '--dev'" } +# Conditionally connect /dev/tty when +# the environment variable TTY is set to 1 +if ${TTY+false}; then + TTY=no +fi R= prompt() { - # expects to be called as prompt "Do you want to do this? [Y/n]" + # expects to be called as prompt "Do you want to do this? [Y/n] " printf "$1" - read R