You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2014/09/03 23:07:13 UTC
[2/2] 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/61aee683
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/61aee683
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/61aee683
Branch: refs/heads/master
Commit: 61aee683e65e5382f75bd8304614d32574b5d918
Parents: 88c8ded
Author: Shazron Abdullah <sh...@apache.org>
Authored: Wed Sep 3 13:56:13 2014 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Wed Sep 3 14:06:38 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/61aee683/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;
}