blob: c7e40fe323762cf10a10e1165c827d52db022d1b [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var spawn = require('child_process').spawn;
2
3module.exports = function(argv) {
4 var child = spawn(argv[0], argv.slice(1), { stdio: 'inherit' });
5 child.on('exit', function(code, signal) {
6 process.on('exit', function() {
7 /* istanbul ignore if */
8 if (signal) {
9 process.kill(process.pid, signal);
10 } else {
11 process.exit(code);
12 }
13 });
14 });
15 return child;
16};