Explicitly read answers from `/dev/tty`

This is necessary if **yadm** is started by piping it into `bash`.
This commit is contained in:
Tim Byrne 2017-01-27 16:58:20 -06:00
parent 7f6fe24280
commit a612a98136
No known key found for this signature in database
GPG Key ID: 6CBE24C2FD8CF76E
1 changed files with 2 additions and 2 deletions

4
yadm
View File

@ -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