From a612a9813602d0bc0fbc2eb5ef5a7519b1b08551 Mon Sep 17 00:00:00 2001 From: Tim Byrne Date: Fri, 27 Jan 2017 16:58:20 -0600 Subject: [PATCH] Explicitly read answers from `/dev/tty` This is necessary if **yadm** is started by piping it into `bash`. --- yadm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yadm b/yadm index 39d66cb..65df72f 100755 --- a/yadm +++ b/yadm @@ -395,7 +395,7 @@ function encrypt() { if [[ $archive_status =~ $archive_regex ]] ; then echo "It appears that $YADM_ARCHIVE is not tracked by yadm's repository." echo "Would you like to add it now? (y/n)" - read -r answer + read -r answer < /dev/tty if [[ $answer =~ ^[yY]$ ]] ; then "$GIT_PROGRAM" add "$(mixed_path "$YADM_ARCHIVE")" fi @@ -707,7 +707,7 @@ function auto_bootstrap() { echo "Found $YADM_BOOTSTRAP" echo "It appears that a bootstrap program exists." echo "Would you like to execute it now? (y/n)" - read -r answer + read -r answer < /dev/tty if [[ $answer =~ ^[yY]$ ]] ; then bootstrap fi