Skip to content

Commit

Permalink
Only listen for stdin close on TTYs (#8523)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecrypticace committed Jun 6, 2022
1 parent 436b543 commit 14f6574
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/cli.js
Expand Up @@ -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()
Expand Down

0 comments on commit 14f6574

Please sign in to comment.