cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: CB-5006 Change searchpath to use repeated flag instead of delimiter
Date Tue, 14 Jan 2014 16:19:24 GMT
Updated Branches:
  refs/heads/master 401f790ff -> ece3a3dae


CB-5006 Change searchpath to use repeated flag instead of delimiter

The colon can't be used as delimiter for Windows paths like C:\...
Instead of using a delimiter, this change allows to repeat the
--searchpath flag for each additional directory to be searched.
The value for each path is resolved relative to the current dir.
Example:
--searchpath ../my_plugins --searhcpath /usr/lib/other_plugins

The dirs are searched in order. Search is not recursive and will only
look one level down. It will look for
my_plugins/plugin_x/plugin.xml
but not for
my_plugins/bunch_of_plugins/plugin_y/plugin.xml


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

Branch: refs/heads/master
Commit: ece3a3dae78a91ba910bb233bc5f5129eb3d3cb8
Parents: 401f790
Author: Mark Koudritsky <kamrik@chromium.org>
Authored: Wed Jan 8 13:52:31 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jan 14 11:19:04 2014 -0500

----------------------------------------------------------------------
 doc/help.txt | 3 ++-
 main.js      | 2 +-
 plugman.js   | 2 +-
 src/fetch.js | 3 +++
 4 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ece3a3da/doc/help.txt
----------------------------------------------------------------------
diff --git a/doc/help.txt b/doc/help.txt
index 1ab3467..2f4fb58 100644
--- a/doc/help.txt
+++ b/doc/help.txt
@@ -28,7 +28,8 @@ Optional parameters
 
  - www <directory>: www assets for the plugin will be installed into this directory.
Default is to install into the standard www directory for the platform specified
  - plugins_dir <directory>: a copy of the plugin will be stored in this directory.
Default is to install into the <project directory>/plugins folder
- - searchpath <directory>: a colon separated list of directories to scan for a plugin
with the provided ID before looking on http://plugins.cordova.io
+ - searchpath <directory>: a directory to look in for a plugin with the provided ID
before looking on http://plugins.cordova.io
+   Use the searchpath flag multiple times to specify several directories (searched in order).
The search is not recursive and will only look one level down.
 
 Optional flags
 --------------

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ece3a3da/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 877c563..92cc477 100755
--- a/main.js
+++ b/main.js
@@ -38,7 +38,7 @@ var known_opts = { 'platform' : [ 'ios', 'android', 'amazon-fireos', 'blackberry
         , 'link': Boolean
         , 'variable' : Array
         , 'www': path
-        , 'searchpath' : String
+        , 'searchpath' : [path, Array]
 }, shortHands = { 'var' : ['--variable'], 'v': ['--version'], 'h': ['--help'] };
 
 var cli_opts = nopt(known_opts, shortHands);

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ece3a3da/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
old mode 100755
new mode 100644
index 4c0f61b..bd70732
--- a/plugman.js
+++ b/plugman.js
@@ -98,7 +98,7 @@ plugman.commands =  {
             subdir: '.',
             cli_variables: cli_variables,
             www_dir: cli_opts.www,
-            searchpath: cli_opts.searchpath ? cli_opts.searchpath.split(':') : []
+            searchpath: cli_opts.searchpath
         };
         return plugman.install(cli_opts.platform, cli_opts.project, cli_opts.plugin, cli_opts.plugins_dir,
opts);
     },

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/ece3a3da/src/fetch.js
----------------------------------------------------------------------
diff --git a/src/fetch.js b/src/fetch.js
index 2f45f5f..71df720 100644
--- a/src/fetch.js
+++ b/src/fetch.js
@@ -18,6 +18,9 @@ module.exports = function fetchPlugin(plugin_src, plugins_dir, options)
{
     options = options || {};
     options.subdir = options.subdir || '.';
     options.searchpath = options.searchpath || [];
+    if ( typeof options.searchpath === 'string' ) {
+        options.searchpath = [ options.searchpath ];
+    }
 
     // clone from git repository
     var uri = url.parse(plugin_src);


Mime
View raw message