cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kam...@apache.org
Subject git commit: Add --noregstry flag for disabling plugin lookup in the registry
Date Fri, 16 May 2014 01:05:56 GMT
Repository: cordova-cli
Updated Branches:
  refs/heads/master cd9b69691 -> ee34eeefc


Add --noregstry flag for disabling plugin lookup in the registry


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

Branch: refs/heads/master
Commit: ee34eeefc6d496dac27dc2f397b5dbf6976ef725
Parents: cd9b696
Author: Mark Koudritsky <kamrik@gmail.com>
Authored: Thu May 15 21:05:16 2014 -0400
Committer: Mark Koudritsky <kamrik@gmail.com>
Committed: Thu May 15 21:05:16 2014 -0400

----------------------------------------------------------------------
 spec/cli.spec.js | 6 +++++-
 src/cli.js       | 9 +++++++--
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/ee34eeef/spec/cli.spec.js
----------------------------------------------------------------------
diff --git a/spec/cli.spec.js b/spec/cli.spec.js
index ec10815..5720ed2 100644
--- a/spec/cli.spec.js
+++ b/spec/cli.spec.js
@@ -100,7 +100,11 @@ describe("cordova cli", function () {
 
         it("will call command with all arguments passed through", function () {
             new CLI(["node", "cordova", "plugin", "add", "facebook", "--variable", "FOO=foo"]);
-            expect(cordova.raw.plugin).toHaveBeenCalledWith("add", ["facebook", "--variable",
"FOO=foo"], {searchpath: undefined});
+            expect(cordova.raw.plugin).toHaveBeenCalledWith(
+                "add",
+                ["facebook", "--variable", "FOO=foo"],
+                jasmine.any(Object)
+            );
         });
     });
 });

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/ee34eeef/src/cli.js
----------------------------------------------------------------------
diff --git a/src/cli.js b/src/cli.js
index b90a540..b111482 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -52,6 +52,7 @@ module.exports = function CLI(inputArgs) {
         .boolean('version')
         .boolean('silent')
         .boolean('experimental')
+        .boolean('noregistry')
         .string('copy-from')
         .alias('copy-from', 'src')
         .string('link-to')
@@ -108,10 +109,14 @@ module.exports = function CLI(inputArgs) {
         }
     }
 
-    if (opts.experimental) {
+    if (args.experimental) {
         tokens.splice(tokens.indexOf("--experimental"), 1);
     }
 
+    if (args.noregistry) {
+        tokens.splice(tokens.indexOf("--noregistry"), 1);
+    }
+
     var cmd = tokens && tokens.length ? tokens.splice(0,1) : undefined;
     if (cmd === undefined) {
         return help();
@@ -164,6 +169,6 @@ module.exports = function CLI(inputArgs) {
         // platform/plugins add/rm [target(s)]
         var subcommand = tokens[0]; // this has the sub-command, like "add", "ls", "rm" etc.
         var targets = tokens.slice(1); // this should be an array of targets, be it platforms
or plugins
-        cordova.raw[cmd].call(this, subcommand, targets, { searchpath: args.searchpath }).done();
+        cordova.raw[cmd].call(this, subcommand, targets, { searchpath: args.searchpath, noregistry:
args.noregistry }).done();
     }
 };


Mime
View raw message