cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [1/8] cordova-lib git commit: Ubuntu support for the new plugin naming convention
Date Sat, 05 Dec 2015 01:26:55 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 46305f17f -> d530d7a35


Ubuntu support for the new plugin naming convention


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/187711dd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/187711dd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/187711dd

Branch: refs/heads/master
Commit: 187711dd7fb7cd21e9ea276239b2e8b87a9e1ee6
Parents: b0c1965
Author: David Barth <david.barth@canonical.com>
Authored: Tue Sep 1 19:40:35 2015 +0200
Committer: David Barth <david.barth@canonical.com>
Committed: Tue Sep 1 19:40:35 2015 +0200

----------------------------------------------------------------------
 cordova-lib/src/plugman/platforms/ubuntu.js | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/187711dd/cordova-lib/src/plugman/platforms/ubuntu.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ubuntu.js b/cordova-lib/src/plugman/platforms/ubuntu.js
index d79f747..c15d506 100644
--- a/cordova-lib/src/plugman/platforms/ubuntu.js
+++ b/cordova-lib/src/plugman/platforms/ubuntu.js
@@ -71,7 +71,13 @@ module.exports = {
             var src = String(fs.readFileSync(plugins));
 
             src = src.replace('INSERT_HEADER_HERE', '#include "plugins/' + plugin_id + '/'
+ path.basename(obj.src) +'"\nINSERT_HEADER_HERE');
-            var class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
+            var class_name;
+            if (plugin_id.match(/\.[^.]+$/)) {
+            // old-style plugin name
+                class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
+            } else {
+               class_name = plugin_id.match(/\-[^\-]+$/)[0].substr(1);
+            }
             class_name = toCamelCase(class_name);
             src = src.replace('INSERT_PLUGIN_HERE', 'INIT_PLUGIN(' + class_name + ');INSERT_PLUGIN_HERE');
 
@@ -85,7 +91,13 @@ module.exports = {
             var src = String(fs.readFileSync(plugins));
 
             src = src.replace('#include "plugins/' + plugin_id + '/' + path.basename(obj.src)
+'"', '');
-            var class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
+            var class_name;
+            if (plugin_id.match(/\.[^.]+$/)) {
+                // old-style plugin name
+                class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
+            } else {
+                class_name = plugin_id.match(/\-[^\-]+$/)[0].substr(1);
+            }
             class_name = toCamelCase(class_name);
             src = src.replace('INIT_PLUGIN(' + class_name + ');', '');
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message