wallet-core/node_modules/flagged-respawn/lib/respawn.js

17 lines
409 B
JavaScript
Raw Normal View History

2016-10-10 03:43:44 +02:00
const spawn = require('child_process').spawn;
module.exports = function (argv) {
var child = spawn(argv[0], argv.slice(1), { stdio: 'inherit' });
child.on('exit', function (code, signal) {
process.on('exit', function () {
2018-09-20 02:56:13 +02:00
/* istanbul ignore if */
2016-10-10 03:43:44 +02:00
if (signal) {
process.kill(process.pid, signal);
} else {
process.exit(code);
}
});
});
return child;
};