[CB-4259] Updating cordova/plugin to pass through to better support urls Reviewed by Bryan Higgins <[email protected]> Tested by Tracy Li <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/8a361f95 Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/8a361f95 Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/8a361f95 Branch: refs/heads/master Commit: 8a361f95822eaac04be781aa036af100ca695e7c Parents: 91b9453 Author: Jeffrey Heifetz <[email protected]> Authored: Mon Jul 15 10:49:34 2013 -0400 Committer: Bryan Higgins <[email protected]> Committed: Mon Jul 15 20:51:01 2013 -0400 ---------------------------------------------------------------------- .../bin/templates/project/cordova/lib/plugin.js | 40 ++++++++++---------- 1 file changed, 21 insertions(+), 19 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/8a361f95/blackberry10/bin/templates/project/cordova/lib/plugin.js ---------------------------------------------------------------------- diff --git a/blackberry10/bin/templates/project/cordova/lib/plugin.js b/blackberry10/bin/templates/project/cordova/lib/plugin.js index 7e1412c..38bbb33 100644 --- a/blackberry10/bin/templates/project/cordova/lib/plugin.js +++ b/blackberry10/bin/templates/project/cordova/lib/plugin.js @@ -99,34 +99,36 @@ function addPlugin (pluginPath) { pluginDirs = [], allFiles; + //Check if the path they sent in exists if (!fs.existsSync(plugin) ) { //Check if the plugin has been fetched globally plugin = path.resolve(GLOBAL_PLUGIN_PATH, plugin); - if (!fs.existsSync(plugin)) { - console.log("Input ", pluginPath || argumentor.plugin, " cannot be resolved as a plugin"); - listHelp(); - process.exit(1); - } } - allFiles = wrench.readdirSyncRecursive(plugin); - allFiles.forEach(function (file) { - var fullPath = path.resolve(plugin, file); + //Check if the new global path is good, if not just pass through + if (!fs.existsSync(plugin)) { + plugmanInterface.install(pluginPath || argumentor.plugin); + } else { - if (path.basename(file) === "plugin.xml") { - pluginDirs.push(path.dirname(fullPath)); - } - }); + allFiles = wrench.readdirSyncRecursive(plugin); + allFiles.forEach(function (file) { + var fullPath = path.resolve(plugin, file); - if (!pluginDirs.length) { - console.log("No plugins could be found given the input " + pluginPath || argumentor.plugin); - listHelp(); - process.exit(1); - } else { - pluginDirs.forEach(function (pluginDir) { - plugmanInterface.install(pluginDir); + if (path.basename(file) === "plugin.xml") { + pluginDirs.push(path.dirname(fullPath)); + } }); + + if (!pluginDirs.length) { + console.log("No plugins could be found given the input " + pluginPath || argumentor.plugin); + listHelp(); + process.exit(1); + } else { + pluginDirs.forEach(function (pluginDir) { + plugmanInterface.install(pluginDir); + }); + } } }
