WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit ae7fed4

Browse files
committed
kill child process on SIGTERM, fixes #88
1 parent 31e8fe8 commit ae7fed4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cli.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,11 @@ var input = process.argv.slice(2);
1414
var bin = require('./');
1515

1616
if (bin !== null) {
17-
spawn(bin, input, {stdio: 'inherit'})
17+
var child = spawn(bin, input, {stdio: 'inherit'})
1818
.on('exit', process.exit);
19+
process.on('SIGTERM', function() {
20+
child.kill();
21+
});
1922
} else {
2023
throw new Error('Platform not supported.');
2124
}

0 commit comments

Comments
 (0)