cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [5/9] cordova-lib git commit: CB-9981 path.parse only available on node 0.12+.
Date Fri, 20 Nov 2015 01:08:52 GMT
CB-9981 path.parse only available on node 0.12+.

This closes #340


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

Branch: refs/heads/5.4.x
Commit: 3fba809f23b9c18b41fc17c8b898f21ffc2804f6
Parents: 701151d
Author: ivan baktsheev <dot.and.thing@gmail.com>
Authored: Mon Nov 9 22:42:28 2015 +0300
Committer: Steve Gill <stevengill97@gmail.com>
Committed: Thu Nov 19 16:40:20 2015 -0800

----------------------------------------------------------------------
 cordova-lib/src/plugman/platforms/common.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/3fba809f/cordova-lib/src/plugman/platforms/common.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/common.js b/cordova-lib/src/plugman/platforms/common.js
index 358ceed..df5befa 100644
--- a/cordova-lib/src/plugman/platforms/common.js
+++ b/cordova-lib/src/plugman/platforms/common.js
@@ -128,7 +128,9 @@ module.exports = common = {
         install: function (jsModule, plugin_dir, plugin_id, www_dir) {
             // Copy the plugin's files into the www directory.
             var moduleSource = path.resolve(plugin_dir, jsModule.src);
-            var moduleName = plugin_id + '.' + (jsModule.name || path.parse(jsModule.src).name);
+            // Get module name based on existing 'name' attribute or filename
+            // Must use path.extname/path.basename instead of path.parse due to CB-9981
+            var moduleName = plugin_id + '.' + (jsModule.name || path.basename(jsModule.src,
path.extname (jsModule.src)));
 
             // Read in the file, prepend the cordova.define, and write it back out.
             var scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/,
''); // Window BOM


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


Mime
View raw message