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