2018-09-13 16:57:39 +00:00
|
|
|
const cp = require('child_process')
|
|
|
|
const utils = require('./lib/utils')
|
|
|
|
const electronPath = utils.getAbsoluteElectronExec()
|
|
|
|
|
2018-09-28 23:17:00 +00:00
|
|
|
const child = cp.spawn(electronPath, process.argv.slice(2), { stdio: 'inherit' })
|
2018-09-13 16:57:39 +00:00
|
|
|
child.on('close', (code) => process.exit(code))
|
|
|
|
|
|
|
|
const handleTerminationSignal = (signal) =>
|
|
|
|
process.on(signal, () => {
|
|
|
|
if (!child.killed) {
|
|
|
|
child.kill(signal)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
handleTerminationSignal('SIGINT')
|
|
|
|
handleTerminationSignal('SIGTERM')
|