Skip to content

Commit b77c047

Browse files
committed
Better error message when not running in a tty
-t returns true if the provided file descriptor is open and refers to a terminal.
1 parent 68848c9 commit b77c047

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

rustup-init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ main() {
114114
# reading stdin. This script was piped into `sh` though and
115115
# doesn't have stdin to pass to its children. Instead we're going
116116
# to explicitly connect /dev/tty to the installer's stdin.
117-
if [ ! -e "/dev/tty" ]; then
118-
err "/dev/tty does not exist"
117+
if [ ! -t 1 ]; then
118+
err "Unable to run interactively. Run with -y to accept defaults, --help for additional options"
119119
fi
120120

121121
run "$_file" "$@" < /dev/tty

0 commit comments

Comments
 (0)