cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject git commit: CB-6854 Strip BOM when adding cordova.define() to js-modules
Date Tue, 03 Jun 2014 18:23:49 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 55810360f -> 71e7ba31e


CB-6854 Strip BOM when adding cordova.define() to js-modules


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

Branch: refs/heads/master
Commit: 71e7ba31eb85a951f0e0b40a122bd63724ce0567
Parents: 5581036
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Jun 3 14:23:26 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Jun 3 14:23:26 2014 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/prepare.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/71e7ba31/cordova-lib/src/plugman/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/prepare.js b/cordova-lib/src/plugman/prepare.js
index bb7b0f9..c2fbda1 100644
--- a/cordova-lib/src/plugman/prepare.js
+++ b/cordova-lib/src/plugman/prepare.js
@@ -178,7 +178,7 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir,
www_
             }
 
             var fsPath = path.join.apply(path, pathParts);
-            var scriptContent = fs.readFileSync(path.join(pluginDir, fsPath), 'utf-8');
+            var scriptContent = fs.readFileSync(path.join(pluginDir, fsPath), 'utf-8').replace(/^\ufeff/,
''); // Window BOM
             scriptContent = 'cordova.define("' + moduleName + '", function(require, exports,
module) { ' + scriptContent + '\n});\n';
             fs.writeFileSync(path.join(platformPluginsDir, plugin_id, fsPath), scriptContent,
'utf-8');
             if(platform == 'wp7' || platform == 'wp8' || platform == "windows8") {


Mime
View raw message