Skip to content

Commit b525d77

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

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)