From 0600431cec64fc2cfacb89d3020a9bdc5d5d63d8 Mon Sep 17 00:00:00 2001 From: Katie Gengler Date: Fri, 3 Apr 2015 00:30:19 -0400 Subject: [PATCH] Had a finally instead of a then, fixes #5 - Small messaging change to a warning --- lib/tasks/try.js | 9 +++++++-- lib/utils/scenario-manager.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/tasks/try.js b/lib/tasks/try.js index f7d78221..01b5a27c 100644 --- a/lib/tasks/try.js +++ b/lib/tasks/try.js @@ -10,7 +10,7 @@ module.exports = Task.extend({ var task = this; process.on('SIGINT', function() { - console.log( "\nGracefully shutting down from SIGINT (Ctrl-C)" ); + task.ui.writeLine( "\nGracefully shutting down from SIGINT (Ctrl-C)" ); BowerHelpers.cleanup(task.project.root).then(function(){ process.exit( ); }); @@ -27,7 +27,7 @@ module.exports = Task.extend({ return RSVP.resolve(false); }); }) - .finally(function(result){ + .then(function(result){ return BowerHelpers.cleanup(task.project.root).then(function(){ if(!result){ task.ui.writeLine(''); @@ -38,6 +38,11 @@ module.exports = Task.extend({ process.exit(0); } }); + }) + .catch(function(err){ + task.ui.writeLine(err); + task.ui.writeLine(err.stack); + process.exit(1); }); } }); diff --git a/lib/utils/scenario-manager.js b/lib/utils/scenario-manager.js index d6f265b9..96f30317 100644 --- a/lib/utils/scenario-manager.js +++ b/lib/utils/scenario-manager.js @@ -36,7 +36,7 @@ module.exports = CoreObject.extend({ actualVersion = BowerHelpers.findVersion(dep, manager.project.root); expectedVersion = scenario.dependencies[dep]; if(actualVersion !== expectedVersion) { - manager.ui.writeLine(Chalk.yellow("Versions do not match: Expected: " + expectedVersion + " but saw " + actualVersion)); + manager.ui.writeLine(Chalk.yellow("Versions do not match: Expected: " + expectedVersion + " but saw " + actualVersion + " This might be ok, depending on the scenario")); } manager.ui.writeLine(" " + dep + " " + actualVersion); });