You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2014/05/16 03:05:54 UTC

git commit: Add --noregstry flag for disabling plugin lookup in the registry

Repository: cordova-lib
Updated Branches:
  refs/heads/master b270829a6 -> 8e13d11fd


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


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

Branch: refs/heads/master
Commit: 8e13d11fd8a4e994db25a2af75520165167cd47f
Parents: b270829
Author: Mark Koudritsky <ka...@gmail.com>
Authored: Thu May 15 21:02:03 2014 -0400
Committer: Mark Koudritsky <ka...@gmail.com>
Committed: Thu May 15 21:02:03 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/cordova/plugin.js | 2 +-
 cordova-lib/src/plugman/fetch.js  | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/8e13d11f/cordova-lib/src/cordova/plugin.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/plugin.js b/cordova-lib/src/cordova/plugin.js
index c6da55e..bd88386 100644
--- a/cordova-lib/src/cordova/plugin.js
+++ b/cordova-lib/src/cordova/plugin.js
@@ -112,7 +112,7 @@ module.exports = function plugin(command, targets, opts) {
                         // Fetch the plugin first.
                         events.emit('verbose', 'Calling plugman.fetch on plugin "' + target + '"');
                         var plugman = require('../plugman/plugman');
-                        return plugman.raw.fetch(target, pluginsDir, { searchpath: searchPath});
+                        return plugman.raw.fetch(target, pluginsDir, { searchpath: searchPath, noregistry: opts.noregistry});
                     })
                     .then(function(dir) {
                         // Iterate (in serial!) over all platforms in the project and install the plugin.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/8e13d11f/cordova-lib/src/plugman/fetch.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/fetch.js b/cordova-lib/src/plugman/fetch.js
index b8a43c1..c0a6d7a 100644
--- a/cordova-lib/src/plugman/fetch.js
+++ b/cordova-lib/src/plugman/fetch.js
@@ -82,6 +82,11 @@ module.exports = function fetchPlugin(plugin_src, plugins_dir, options) {
             if (local_dir) {
                 p = Q(local_dir);
                 events.emit('verbose', 'Found ' + plugin_src + ' at ' + local_dir);
+            } else if ( options.noregistry ) {
+                p = Q.reject(new CordovaError(
+                        'Plugin ' + plugin_src + ' not found locally. ' +
+                        'Note, plugin registry was disabled by --noregistry flag.'
+                    ));
             } else {
                 // If not found in local search path, fetch from the registry.
                 linkable = false;