mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
Don't process.exit(null) when e.g build is SIGKILL
ed (#887)
This commit is contained in:
parent
a76ec83b64
commit
51cbebb240
14
bin/next
14
bin/next
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue