mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 06:06:01 +00:00
26 lines
595 B
JavaScript
26 lines
595 B
JavaScript
#!/usr/bin/env node
|
|
|
|
var electron = require('electron');
|
|
|
|
var proc = require('child_process');
|
|
|
|
var child = proc.spawn(electron, ['.'], { stdio: 'inherit', windowsHide: false });
|
|
child.on('close', function (code, signal) {
|
|
if (code === null) {
|
|
console.error(electron, 'exited with signal', signal);
|
|
process.exit(1);
|
|
}
|
|
process.exit(code);
|
|
});
|
|
|
|
const handleTerminationSignal = function (signal) {
|
|
process.on(signal, function signalHandler() {
|
|
if (!child.killed) {
|
|
child.kill(signal);
|
|
}
|
|
});
|
|
};
|
|
|
|
handleTerminationSignal('SIGINT');
|
|
handleTerminationSignal('SIGTERM');
|