You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/01/15 16:34:02 UTC

[2/2] git commit: CB-5006 Fix searchpath not being passed to dependent plugins.

CB-5006 Fix searchpath not being passed to dependent plugins.


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

Branch: refs/heads/master
Commit: 3fdbaf70a83386dbafbaa825d60bcf1bd6198c9c
Parents: 70e835d
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Jan 15 10:33:41 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Jan 15 10:33:41 2014 -0500

----------------------------------------------------------------------
 src/plugin.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/3fdbaf70/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index 3d04600..5ef98ce 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -84,6 +84,7 @@ module.exports = function plugin(command, targets, opts) {
             }
 
             var config_json = config(projectRoot, {});
+            var searchPath = opts.searchpath || config_json.plugin_search_path;
 
             return hooks.fire('before_plugin_add', opts)
             .then(function() {
@@ -97,7 +98,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');
-                        return plugman.raw.fetch(target, pluginsDir, { searchpath: opts.searchpath || config_json.plugin_search_path });
+                        return plugman.raw.fetch(target, pluginsDir, { searchpath: searchPath});
                     })
                     .fail(function(err) {
                         return Q.reject(new Error('Fetching plugin failed: ' + err));
@@ -111,7 +112,8 @@ module.exports = function plugin(command, targets, opts) {
                                     parser = new platforms[platform].parser(platformRoot),
                                     options = {
                                         www_dir: parser.staging_dir(),
-                                        cli_variables: {}
+                                        cli_variables: {},
+                                        searchpath: searchPath
                                     },
                                     tokens,
                                     key,