Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
466a03e27b | |||
fe5e220087 | |||
7ad7749ba7 | |||
3f0c9e9fe0 |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartexit",
|
"name": "@pushrocks/smartexit",
|
||||||
"version": "1.0.13",
|
"version": "1.0.15",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartexit",
|
"name": "@pushrocks/smartexit",
|
||||||
"version": "1.0.13",
|
"version": "1.0.15",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "do things before one exists a process",
|
"description": "do things before one exists a process",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
|
@ -32,9 +32,9 @@ export class SmartExit {
|
|||||||
if (childProcessArg.killed) {
|
if (childProcessArg.killed) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
process.kill(-pid, 'SIGKILL');
|
process.kill(pid, 'SIGKILL');
|
||||||
});
|
});
|
||||||
process.kill(-pid, 'SIGINT');
|
process.kill(pid, 'SIGINT');
|
||||||
|
|
||||||
counter++;
|
counter++;
|
||||||
});
|
});
|
||||||
@ -59,6 +59,7 @@ export class SmartExit {
|
|||||||
process.on('SIGINT', async () => {
|
process.on('SIGINT', async () => {
|
||||||
ora.text('Ctrl-C... or SIGINT signal received!');
|
ora.text('Ctrl-C... or SIGINT signal received!');
|
||||||
await this.killAll();
|
await this.killAll();
|
||||||
|
process.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
//catch uncaught exceptions, trace, then exit normally
|
//catch uncaught exceptions, trace, then exit normally
|
||||||
@ -66,6 +67,7 @@ export class SmartExit {
|
|||||||
ora.text('SMARTEXIT: uncaught exception...');
|
ora.text('SMARTEXIT: uncaught exception...');
|
||||||
console.log(err);
|
console.log(err);
|
||||||
await this.killAll();
|
await this.killAll();
|
||||||
|
process.exit(1);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user