CB-10569 Mobilespec doesn't use edge versions of plugins
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 @@
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 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 !== "";
});
}