Only listen for stdin close on TTYs (#8523)

This commit is contained in:
Jordan Pittman 2022-06-06 10:04:18 -04:00 committed by GitHub
parent 436b543d70
commit 14f6574318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -875,8 +875,10 @@ async function build() {
if (shouldWatch) {
/* Abort the watcher if stdin is closed to avoid zombie processes */
process.stdin.on('end', () => process.exit(0))
process.stdin.resume()
if (process.stdin.isTTY) {
process.stdin.on('end', () => process.exit(0))
process.stdin.resume()
}
startWatcher()
} else {
buildOnce()