electron/script/start.js
Milan Burda abec9ead06
refactor: use node scheme imports in scripts (#38846)
* refactor: use node scheme imports in script

* refactor: use node scheme imports in build
2023-06-22 16:21:42 +02:00

17 lines
512 B
JavaScript

const cp = require('node:child_process');
const utils = require('./lib/utils');
const electronPath = utils.getAbsoluteElectronExec();
const child = cp.spawn(electronPath, process.argv.slice(2), { stdio: 'inherit' });
child.on('close', (code) => process.exit(code));
const handleTerminationSignal = (signal) =>
process.on(signal, () => {
if (!child.killed) {
child.kill(signal);
}
});
handleTerminationSignal('SIGINT');
handleTerminationSignal('SIGTERM');
handleTerminationSignal('SIGUSR2');