fix: do not ignore electron exit signals in cli.js wrapper (#22878)
When the electron child process exits with a signal, the close event handler receives code null and the cli wrapper would silently exit successfully. Fix it to log a message and exit with a nonzero code in this case. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
27d6266b2d
commit
1746ae8c35
1 changed files with 5 additions and 1 deletions
|
@ -5,7 +5,11 @@ var electron = require('./')
|
||||||
var proc = require('child_process')
|
var proc = require('child_process')
|
||||||
|
|
||||||
var child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit', windowsHide: false })
|
var child = proc.spawn(electron, process.argv.slice(2), { stdio: 'inherit', windowsHide: false })
|
||||||
child.on('close', function (code) {
|
child.on('close', function (code, signal) {
|
||||||
|
if (code === null) {
|
||||||
|
console.error(electron, 'exited with signal', signal)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
process.exit(code)
|
process.exit(code)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue