diff --git a/lib/builder.js b/lib/builder.js index 6902580..94c1059 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -83,8 +83,12 @@ exports.start = function (json, options, buildCallback) { buildStat, end = function (err) { var end = new Date(); - log.info('done racing, the gears are toast'); - log.info('finished in ' + timer.calc(start, end) + ', pretty fast huh?'); + if (err) { + log.err('Build failed: Errors encountered during build'); + } else { + log.info('done racing, the gears are toast'); + log.info('finished in ' + timer.calc(start, end)); + } if (buildCallback) { buildCallback(err); } diff --git a/lib/index.js b/lib/index.js index bc1d7f1..e98ad78 100644 --- a/lib/index.js +++ b/lib/index.js @@ -46,10 +46,16 @@ var runQueue = function() { } }; +function standardExitCallback(err) { + if (err) { + process.exit(1); + } +} + function logAndExit(err) { if (err) { log.err(err); - process.exit(1); + standardExitCallback(err); } } @@ -70,7 +76,7 @@ exports.init = function (opts, initCallback) { log.reset(options); if (!initCallback) { - initCallback = logAndExit; + initCallback = standardExitCallback; } if (options.cwd) {