ryugyosoft commited on
Commit
a59c8f9
·
verified ·
1 Parent(s): 0a06489

install.sh: use /dev/tty only when it can be opened

Browse files
Files changed (1) hide show
  1. install.sh +1 -1
install.sh CHANGED
@@ -39,7 +39,7 @@ for f in files:
39
  print(f"Downloaded {len(files)} files.")
40
  PY
41
  cd "$dest"
42
- if [ -r /dev/tty ] && [ -w /dev/tty ]; then
43
  bash setup.sh </dev/tty # piped from curl: setup's questions (sudo) read the terminal
44
  else
45
  bash setup.sh
 
39
  print(f"Downloaded {len(files)} files.")
40
  PY
41
  cd "$dest"
42
+ if { : </dev/tty; } 2>/dev/null; then # a real terminal: setup can ask for the sudo password
43
  bash setup.sh </dev/tty # piped from curl: setup's questions (sudo) read the terminal
44
  else
45
  bash setup.sh