Skip to content

Commit 14f6574

Browse files
Only listen for stdin close on TTYs (#8523)
1 parent 436b543 commit 14f6574

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/cli.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -875,8 +875,10 @@ async function build() {
875875

876876
if (shouldWatch) {
877877
/* Abort the watcher if stdin is closed to avoid zombie processes */
878-
process.stdin.on('end', () => process.exit(0))
879-
process.stdin.resume()
878+
if (process.stdin.isTTY) {
879+
process.stdin.on('end', () => process.exit(0))
880+
process.stdin.resume()
881+
}
880882
startWatcher()
881883
} else {
882884
buildOnce()

0 commit comments

Comments
 (0)