diff --git a/lib/config/load.js b/lib/config/load.js index a6dccd87..ddec54fd 100644 --- a/lib/config/load.js +++ b/lib/config/load.js @@ -208,8 +208,8 @@ function loadFile(options, config, dir, ready) { config.loaded.push(filename); } } catch (e) { - console.error(e); utils.log.fail('Failed to parse config ' + filename); + console.error(e); process.exit(1); } diff --git a/lib/monitor/run.js b/lib/monitor/run.js index 06e39eb1..8169ecd3 100644 --- a/lib/monitor/run.js +++ b/lib/monitor/run.js @@ -397,16 +397,15 @@ process.on('exit', function () { // because windows borks when listening for the SIG* events if (!utils.isWindows) { - // usual suspect: ctrl+c exit - process.once('SIGINT', function () { - bus.emit('quit'); - }); - - process.once('SIGTERM', function () { - bus.emit('quit'); - if (child) { child.kill('SIGTERM'); } - process.exit(0); - }); + bus.once('boot', () => { + // usual suspect: ctrl+c exit + process.once('SIGINT', () => bus.emit('quit')); + process.once('SIGTERM', () => { + bus.emit('quit'); + if (child) { child.kill('SIGTERM'); } + process.exit(0); + }); + }) } diff --git a/lib/nodemon.js b/lib/nodemon.js index 3403cdd2..13961b8b 100644 --- a/lib/nodemon.js +++ b/lib/nodemon.js @@ -17,6 +17,7 @@ var eventHandlers = {}; config.required = utils.isRequired; function nodemon(settings) { + bus.emit('boot'); nodemon.reset(); // allow the cli string as the argument to nodemon, and allow for