From a5098b7758d6ad11e7fa7f2b0b22090088103314 Mon Sep 17 00:00:00 2001 From: Omar Mefire Date: Tue, 10 Mar 2015 23:46:07 -0700 Subject: [PATCH] CB-7698 BugFix: For plugins which require variables, 'cordova plugin add FOO' should fail when no variables specified. --- cordova-lib/src/cordova/plugin.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js index 497722f3c..5e6053265 100644 --- a/cordova-lib/src/cordova/plugin.js +++ b/cordova-lib/src/cordova/plugin.js @@ -185,8 +185,9 @@ module.exports = function plugin(command, targets, opts) { }); if (missingVariables.length) { shell.rm('-rf', dir); - events.emit('results', 'Variable(s) missing (use: --variable ' + missingVariables.join('=value --variable ') + '=value).'); - return; + var msg = 'Variable(s) missing (use: --variable ' + missingVariables.join('=value --variable ') + '=value).'; + events.emit('results', msg); + return Q.reject(new CordovaError(msg)); } // Iterate (in serial!) over all platforms in the project and install the plugin. return platformList.reduce(function(soFar, platform) {