diff --git a/lib/cmd/start.js b/lib/cmd/start.js index c5e2188..f55e060 100644 --- a/lib/cmd/start.js +++ b/lib/cmd/start.js @@ -156,7 +156,7 @@ class StartCommand extends Command { this.logger.info('%s started on %s', this.frameworkName, msg.data.address); child.unref(); child.disconnect(); - process.exit(0); + this.exit(0); } }); @@ -177,7 +177,7 @@ class StartCommand extends Command { [ 'SIGINT', 'SIGQUIT', 'SIGTERM' ].forEach(event => { process.once(event, () => { signal = event; - process.exit(0); + this.exit(0); }); }); process.once('exit', () => { @@ -246,7 +246,7 @@ class StartCommand extends Command { if (!isSuccess) { this.child.kill('SIGTERM'); yield sleep(1000); - process.exit(1); + this.exit(1); } } } diff --git a/lib/command.js b/lib/command.js index c484252..bd53436 100644 --- a/lib/command.js +++ b/lib/command.js @@ -59,6 +59,10 @@ class Command extends BaseCommand { return context; } + + exit(code) { + process.exit(code); + } } module.exports = Command;