dbgate package

This commit is contained in:
Jan Prochazka
2021-02-01 18:09:57 +01:00
parent bd3c18d883
commit fdf60b5267
3 changed files with 54 additions and 1 deletions

25
app/src/dbgate.js Normal file
View File

@@ -0,0 +1,25 @@
#!/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');