Repository: cordova-mobile-spec
Updated Branches:
  refs/heads/master 44e6f920b -> fe36cf5e0


CB-10569 Mobilespec doesn't use edge versions of plugins


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

Branch: refs/heads/master
Commit: fe36cf5e0c9218454848b63a29cde9ddc21a2cc0
Parents: 44e6f92
Author: Alexander Sorokin <[email protected]>
Authored: Tue Feb 9 18:02:57 2016 +0300
Committer: Alexander Sorokin <[email protected]>
Committed: Tue Feb 9 18:12:58 2016 +0300

----------------------------------------------------------------------
 createmobilespec/createmobilespec.js | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-mobile-spec/blob/fe36cf5e/createmobilespec/createmobilespec.js
----------------------------------------------------------------------
diff --git a/createmobilespec/createmobilespec.js 
b/createmobilespec/createmobilespec.js
index 7b60780..99be813 100755
--- a/createmobilespec/createmobilespec.js
+++ b/createmobilespec/createmobilespec.js
@@ -59,7 +59,15 @@ function pluginAdd(pluginName, searchPath, extraFlags) {
     if (!pluginName) {
         return;
     }
-    var command = cli + ' plugin add ' + pluginName + ' --searchpath ' + 
searchPath;
+    if (!searchPath || typeof searchPath !== "string") {
+        searchPath = '';
+    }
+    var command;
+    if (fs.existsSync(path.join(searchPath, pluginName, 'plugin.xml'))) {
+        command = cli + ' plugin add ' + path.join(searchPath, pluginName);
+    } else {
+        command = cli + ' plugin add ' + pluginName + ' --searchpath ' + 
searchPath;
+    }
     if (extraFlags) {
         command += extraFlags;
     }
@@ -499,8 +507,8 @@ function pluginIdToDirName(id) {
 function installPlugins() {
     var plugins = DEFAULT_PLUGINS;
     if (argv.plugins) {
-        plugins = argv.plugins.split(" ").filter(function (item) { 
-            return item !== ""; 
+        plugins = argv.plugins.split(" ").filter(function (item) {
+            return item !== "";
         });
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to