fix(install): reconnect stdin to tty for interactive TUI in piped execution
Co-authored-by: Junie <junie@jetbrains.com>
This commit is contained in:
+4
-4
@@ -130,12 +130,12 @@ main() {
|
|||||||
fi
|
fi
|
||||||
setup_cmd+=(./setup.sh "$@")
|
setup_cmd+=(./setup.sh "$@")
|
||||||
|
|
||||||
# Execute setup.sh with stdin connected to /dev/tty if stdin is piped (e.g. curl ... | bash)
|
# Reconnect stdin to /dev/tty before executing setup.sh if piped (e.g. curl ... | bash)
|
||||||
if [[ ! -t 0 ]] && [[ -e /dev/tty ]] && ( : < /dev/tty ) 2>/dev/null; then
|
if [[ ! -t 0 ]] && [[ -e /dev/tty ]] && ( : < /dev/tty ) 2>/dev/null; then
|
||||||
"${setup_cmd[@]}" < /dev/tty
|
exec < /dev/tty
|
||||||
else
|
|
||||||
"${setup_cmd[@]}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
"${setup_cmd[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user