From 3d4ccbec23c2801793b80f70a19e9612dc09263c Mon Sep 17 00:00:00 2001 From: Michal Mocny Date: Fri, 29 Nov 2013 14:39:09 -0500 Subject: [PATCH] Moving the console.log out of run() method Since cordova-cli calls the check_req library run() method, we do not want to always console.log on success in there (not usually a useful side effect). --- bin/check_reqs | 13 ++++++++----- bin/lib/check_reqs.js | 4 +--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/check_reqs b/bin/check_reqs index 2ac87521..372a3830 100755 --- a/bin/check_reqs +++ b/bin/check_reqs @@ -21,8 +21,11 @@ var check_reqs = require('./lib/check_reqs'); -check_reqs.run().done(null, function(err) { - console.log(err); - process.exit(2); -}); - +check_reqs.run().done( + function success() { + console.log('Looks like your environment fully supports cordova-android development!'); + }, function fail(err) { + console.log(err); + process.exit(2); + } +); diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js index 5a71b0b6..1c6f0f8c 100644 --- a/bin/lib/check_reqs.js +++ b/bin/lib/check_reqs.js @@ -91,8 +91,6 @@ module.exports.check_android = function() { // Returns a promise. module.exports.run = function() { - return Q.all([this.check_ant(), this.check_java(), this.check_android()]).then(function() { - console.log('Looks like your environment fully supports cordova-android development!'); - }); + return Q.all([this.check_ant(), this.check_java(), this.check_android()]); }