Explicitly read answers from `/dev/tty`

This is necessary if **yadm** is started by piping it into `bash`.
pull/57/head
Tim Byrne 7 years ago
parent 7f6fe24280
commit a612a98136
No known key found for this signature in database
GPG Key ID: 6CBE24C2FD8CF76E

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

Loading…
Cancel
Save