cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [19/50] [abbrv] git commit: CB-7457 - cordova plugin add --searchpath does not recurse through subfolders when a plugin.xml is malformed in one of them
Date Mon, 22 Sep 2014 22:16:11 GMT
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/cb-7219
Commit: 948402112b77dd216c356d16eefae13cd67b8f83
Parents: 5750b76
Author: Shazron Abdullah <shazron@apache.org>
Authored: Wed Sep 3 13:56:13 2014 -0700
Committer: Anis Kadri <anis@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;
 }


Mime
View raw message