From f62c0d55ee64c017bb5881346f020e472d5e7a6e Mon Sep 17 00:00:00 2001 From: Matt Lyons Date: Wed, 21 Oct 2015 23:34:39 -0700 Subject: [PATCH 1/2] refactor: remove deprecated util.error Replace with console.error Replace util.log with console.log to be consistent with _log --- lib/utils/log.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/utils/log.js b/lib/utils/log.js index bccaa81a..aa42b155 100644 --- a/lib/utils/log.js +++ b/lib/utils/log.js @@ -1,4 +1,3 @@ -var util = require('util'); var colour = require('./colour'); var bus = require('./bus'); var required = false; @@ -27,9 +26,9 @@ function log(type, text) { // question: should we actually just consume our own events? if (!required) { if (type === 'error') { - util.error(msg); + console.error(msg); } else { - util.log(msg); + console.log(msg || ''); } } } @@ -62,7 +61,7 @@ Logger.prototype._log = function (type, msg) { if (required) { bus.emit('log', { type: type, message: msg || '', colour: msg || '' }); } else if (type === 'error') { - util.error(msg); + console.error(msg); } else { console.log(msg || ''); } @@ -77,4 +76,4 @@ Object.defineProperty(Logger.prototype, 'useColours', { }, }); -module.exports = Logger; \ No newline at end of file +module.exports = Logger; From d4e662b808b1e33dc9b12c36de5554595deab810 Mon Sep 17 00:00:00 2001 From: Matt Lyons Date: Sun, 25 Oct 2015 00:15:15 -0700 Subject: [PATCH 2/2] feat: exit when fail to parse the config file Fixes #651 --- lib/config/load.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/config/load.js b/lib/config/load.js index 25a1b7f7..13b7aeba 100644 --- a/lib/config/load.js +++ b/lib/config/load.js @@ -179,6 +179,7 @@ function loadFile(options, config, dir, ready) { } catch (e) { console.error(e); utils.log.fail('Failed to parse config ' + filename); + process.exit(1); } // options values will overwrite settings @@ -186,4 +187,4 @@ function loadFile(options, config, dir, ready) { }); -} \ No newline at end of file +}