Skip to content

Commit 35fc16c

Browse files
committed
Only redirect from /dev/tty if stdin is not already a tty
1 parent b694b1a commit 35fc16c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rustup-init.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ main() {
135135
exit 1
136136
fi
137137

138-
if [ "$need_tty" = "yes" ]; then
138+
if [ "$need_tty" = "yes" ] && [ ! -t 0 ]; then
139139
# The installer is going to want to ask for confirmation by
140140
# reading stdin. This script was piped into `sh` though and
141141
# doesn't have stdin to pass to its children. Instead we're going

0 commit comments

Comments
 (0)