diff --git a/index.js b/index.js index 8506b4c..8078fe9 100644 --- a/index.js +++ b/index.js @@ -318,8 +318,9 @@ function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) { er.pkgname = pkg.name } process.removeListener('SIGTERM', procKill) - process.removeListener('SIGTERM', procInterrupt) process.removeListener('SIGINT', procKill) + process.removeListener('SIGINT', procInterrupt) + process.removeListener('exit', procKill) return cb(er) } let called = false @@ -330,9 +331,6 @@ function runCmd_ (cmd, pkg, env, wd, opts, stage, unsafe, uid, gid, cb_) { } function procInterrupt () { proc.kill('SIGINT') - proc.on('exit', () => { - process.exit() - }) process.once('SIGINT', procKill) } } diff --git a/test/fixtures/count-to-10/package.json b/test/fixtures/count-to-10/package.json index aa4ec51..5692a03 100644 --- a/test/fixtures/count-to-10/package.json +++ b/test/fixtures/count-to-10/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "scripts": { "postinstall": "node postinstall", - "signal-abrt": "echo 'signal-exit script' && kill -s ABRT $$", + "signal-abrt": "echo 'signal-abrt script' && kill -s ABRT $$", "signal-int": "echo 'signal-int script' && kill -s INT $$" } }