You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/09/05 20:14:52 UTC
[47/50] git commit: CB-7457 - cordova plugin add --searchpath does
not recurse through subfolders when a plugin.xml is malformed in one of them
CB-7457 - cordova plugin add --searchpath does not recurse through subfolders when a plugin.xml is malformed in one of them
Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/94840211
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/94840211
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/94840211
Branch: refs/heads/master
Commit: 948402112b77dd216c356d16eefae13cd67b8f83
Parents: 5750b76
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Sep 3 13:56:13 2014 -0700
Committer: Anis Kadri <an...@apache.org>
Committed: Fri Sep 5 11:12:20 2014 -0700
----------------------------------------------------------------------
cordova-lib/src/PluginInfo.js | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/94840211/cordova-lib/src/PluginInfo.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/PluginInfo.js b/cordova-lib/src/PluginInfo.js
index 1d2b24a..94d6fb1 100644
--- a/cordova-lib/src/PluginInfo.js
+++ b/cordova-lib/src/PluginInfo.js
@@ -270,10 +270,15 @@ function loadPluginsDir(dirname) {
var plugins = [];
subdirs.forEach(function (subdir) {
var d = path.join(dirname, subdir);
- if (!fs.existsSync(path.join(d, 'plugin.xml')))
+ if (!fs.existsSync(path.join(d, 'plugin.xml'))) {
return; // continue
- var p = new PluginInfo(d);
- plugins.push(p);
+ }
+ try {
+ var p = new PluginInfo(d);
+ plugins.push(p);
+ } catch (e) {
+ // ignore errors while parsing so we can continue with searching
+ }
});
return plugins;
}