cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: When searchpath is specified in config and CLI, merge them.
Date Thu, 06 Mar 2014 15:38:44 GMT
Repository: cordova-cli
Updated Branches:
  refs/heads/master 1b93d0ac9 -> 5b4c8bfd5


When searchpath is specified in config and CLI, merge them.


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

Branch: refs/heads/master
Commit: 5b4c8bfd5048709e4dc8058a780f63b6b7d14d8e
Parents: 1b93d0a
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Mar 6 10:38:14 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Mar 6 10:38:14 2014 -0500

----------------------------------------------------------------------
 src/plugin.js | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/5b4c8bfd/src/plugin.js
----------------------------------------------------------------------
diff --git a/src/plugin.js b/src/plugin.js
index 5ee556a..5d7597c 100644
--- a/src/plugin.js
+++ b/src/plugin.js
@@ -85,7 +85,12 @@ module.exports = function plugin(command, targets, opts) {
             }
 
             var config_json = config(projectRoot, {});
-            var searchPath = opts.searchpath || config_json.plugin_search_path;
+            var searchPath = config_json.plugin_search_path || [];
+            if (typeof opts.searchpath == 'string') {
+                searchPath = opts.searchpath.split(path.delimiter).concat(searchPath);
+            } else if (opts.searchpath) {
+                searchPath = opts.searchpath.concat(searchPath);
+            }
 
             return hooks.fire('before_plugin_add', opts)
             .then(function() {


Mime
View raw message