Commit 51cbebb2 authored by Jarmo Isotalo's avatar Jarmo Isotalo Committed by Guillermo Rauch

Don't process.exit(null) when e.g build is `SIGKILL`ed (#887)

parent a76ec83b
...@@ -46,7 +46,19 @@ const bin = join(__dirname, 'next-' + cmd) ...@@ -46,7 +46,19 @@ const bin = join(__dirname, 'next-' + cmd)
const startProcess = () => { const startProcess = () => {
const proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] }) const proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] })
proc.on('close', (code) => process.exit(code)) proc.on('close', (code, signal) => {
if (code !== null) {
process.exit(code)
}
if (signal) {
if (signal === 'SIGKILL') {
process.exit(137)
}
console.log(`got signal ${signal}, exitting`)
process.exit(1)
}
process.exit(0)
})
proc.on('error', (err) => { proc.on('error', (err) => {
console.error(err) console.error(err)
process.exit(1) process.exit(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment