You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/11/06 22:03:02 UTC

[6/6] git commit: fixes to plugin failure output

fixes to plugin failure output


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/commit/c7bc488a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/tree/c7bc488a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/diff/c7bc488a

Branch: refs/heads/cordova-client
Commit: c7bc488acfe245159d461c6984f4ba8df5504c67
Parents: 9f338e1
Author: Fil Maj <ma...@gmail.com>
Authored: Thu Nov 1 16:10:31 2012 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Nov 1 16:10:31 2012 -0700

----------------------------------------------------------------------
 bin/cordova   |   11 +++++------
 src/plugin.js |    4 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c7bc488a/bin/cordova
----------------------------------------------------------------------
diff --git a/bin/cordova b/bin/cordova
index 6595799..a83cf6c 100755
--- a/bin/cordova
+++ b/bin/cordova
@@ -1,6 +1,6 @@
 #!/usr/bin/env node
-var cordova = require('./../cordova'),
-    tokens  = process.argv.slice(2, process.argv.length);
+var tokens = process.argv.slice(2, process.argv.length),
+    cordova= require('../cordova');
 
 // provide clean output on exceptions rather than dumping a stack trace
 process.on('uncaughtException', function(err){
@@ -8,19 +8,18 @@ process.on('uncaughtException', function(err){
     process.exit(1);
 });
 
-var cmd, version, debug, current;
+var cmd, version = false, verbose = false, current;
 
 while (current = tokens.shift()) {
     if (current[0] == '-') {
-        if (current.indexOf('v') > -1) version = true;
-        if (current.indexOf('d') > -1) debug = true;
+        if (current.indexOf('version') > -1 || current[1] == 'v') version = true;
+        if (current.indexOf('verbose') > -1 || current[1] == 'd') verbose = true;
     } else {
         cmd = current;
         break;
     }
 }
 
-// TODO figure out how to incorporate -d logging
 if (version) {
     console.log(require('../package').version);
 } else if (cmd === undefined) {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/c7bc488a/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index 474d586..4bf5918 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -91,7 +91,7 @@ module.exports = function plugin(command, targets, callback) {
                 intersection.forEach(function(platform) {
                     var cmd = util.format('%s --platform %s --project "%s" --plugin "%s"', cli, platform, path.join(projectRoot, 'platforms', platform), target);
                     var plugin_cli = shell.exec(cmd, {silent:true});
-                    if (plugin_cli.code > 0) throw 'An error occured during plugin installation for ' + platform + '. ' + cli.output;
+                    if (plugin_cli.code > 0) throw 'An error occured during plugin installation for ' + platform + '. ' + plugin_cli.output;
                 });
                 
                 // Add the plugin web assets to the www folder as well
@@ -144,7 +144,7 @@ module.exports = function plugin(command, targets, callback) {
                     intersection.forEach(function(platform) {
                         var cmd = util.format('%s --platform %s --project "%s" --plugin "%s" --remove', cli, platform, path.join(projectRoot, 'platforms', platform), targetPath);
                         var plugin_cli = shell.exec(cmd, {silent:true});
-                        if (plugin_cli.code > 0) throw 'An error occured during plugin uninstallation for ' + platform + '. ' + cli.output;
+                        if (plugin_cli.code > 0) throw 'An error occured during plugin uninstallation for ' + platform + '. ' + plugin_cli.output;
                     });
                     
                     // Remove the plugin web assets to the www folder as well