summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2022-12-11 01:00:00 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2022-12-11 01:00:00 +0100
commit6cf6f423340f060e523c007205b691ec68120f50 (patch)
tree3ec8cb815bfdc77716e7dbebd567c2ef16487a65
parent4a517a012f8cdaa4605ef2f49fd9347e7bc02ba5 (diff)
downloadguix-6cf6f423340f060e523c007205b691ec68120f50.tar.gz
guix-install.sh: Gracefully fail on | bash.
* etc/guix-install.sh (welcome): Print an error message and a hint if
the first read fails.
-rwxr-xr-xetc/guix-install.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index fb9006b3e2..f008593d84 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -615,7 +615,10 @@ https://www.gnu.org/software/guix/
 EOF
     # Don't use ‘read -p’ here!  It won't display when run non-interactively.
     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
 	echo
 	echo "...that ($char) was not a return!"