From 0ef9330c8603ad9b028b481887d2a95ece55f497 Mon Sep 17 00:00:00 2001 From: sgrebnov Date: Mon, 6 Oct 2014 13:05:39 +0400 Subject: [PATCH] CB-7715 Fix windows build if folder has '.(js|htm|etc)' in name --- cordova-lib/src/cordova/metadata/windows_parser.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cordova-lib/src/cordova/metadata/windows_parser.js b/cordova-lib/src/cordova/metadata/windows_parser.js index a18c19b04..a5ae98a56 100644 --- a/cordova-lib/src/cordova/metadata/windows_parser.js +++ b/cordova-lib/src/cordova/metadata/windows_parser.js @@ -270,11 +270,16 @@ module.exports.prototype = { var files = shell.ls('-R', www); files.forEach(function (file) { - if (!file.match(/\.(js|html|css|json)/)) { + if (!file.match(/\.(js|html|css|json)$/i)) { return; } var filePath = path.join(www, file); + // skip if this is a folder + if (!fs.lstatSync(filePath).isFile()) { + return; + } + var content = fs.readFileSync(filePath); if (content[0] !== 0xEF && content[1] !== 0xBE && content[2] !== 0xBB) {