guix-install.sh: Gracefully fail on | bash.
* etc/guix-install.sh (welcome): Print an error message and a hint if the first read fails.
This commit is contained in:
parent
4a517a012f
commit
6cf6f42334
1 changed files with 4 additions and 1 deletions
|
@ -615,7 +615,10 @@ https://www.gnu.org/software/guix/
|
||||||
EOF
|
EOF
|
||||||
# Don't use ‘read -p’ here! It won't display when run non-interactively.
|
# Don't use ‘read -p’ here! It won't display when run non-interactively.
|
||||||
echo -n "Press return to continue..."$'\r'
|
echo -n "Press return to continue..."$'\r'
|
||||||
read -r char
|
if ! read -r char; then
|
||||||
|
echo
|
||||||
|
die "Can't read standard input. Hint: don't pipe scripts into a shell."
|
||||||
|
fi
|
||||||
if [ "$char" ]; then
|
if [ "$char" ]; then
|
||||||
echo
|
echo
|
||||||
echo "...that ($char) was not a return!"
|
echo "...that ($char) was not a return!"
|
||||||
|
|
Reference in a new issue