Skip to content

Commit d4b735b

Browse files
committed
Fix rule for filtering platform specific files.
Treat only files with ".platform" right before file extension are treated as platform specific. See #538
1 parent 4e89fae commit d4b735b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/services/platform-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,8 @@ export class PlatformService implements IPlatformService {
342342
}
343343

344344
private static parsePlatformSpecificFileName(fileName: string, platforms: string[]): any {
345-
var regex = util.format("^(.+?)\.(%s)(\..+?)$", platforms.join("|"));
346-
var parsed = fileName.toLowerCase().match(new RegExp(regex, "i"));
345+
var regex = util.format("^(.+?)\\.(%s)(\\..+?)$", platforms.join("|"));
346+
var parsed = fileName.match(new RegExp(regex, "i"));
347347
if (parsed) {
348348
return {
349349
platform: parsed[2],

test/platform-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ describe('Platform Service Tests', () => {
235235

236236
// Asserts that the files in app folder are process as platform specific
237237
assert.isTrue(fs.exists(path.join(appDestFolderPath, "app" , "test1.js")).wait());
238-
assert.isTrue(fs.exists(path.join(appDestFolderPath, "app", "test1-js")).wait());
238+
assert.isFalse(fs.exists(path.join(appDestFolderPath, "app", "test1-js")).wait());
239239
assert.isFalse(fs.exists(path.join(appDestFolderPath, "app", "test2.js")).wait());
240240
assert.isFalse(fs.exists(path.join(appDestFolderPath, "app", "test2-js")).wait());
241241

@@ -286,7 +286,7 @@ describe('Platform Service Tests', () => {
286286

287287
// Asserts that the files in app folder are process as platform specific
288288
assert.isTrue(fs.exists(path.join(appDestFolderPath, "app" , "test2.js")).wait());
289-
assert.isTrue(fs.exists(path.join(appDestFolderPath, "app", "test2-js")).wait());
289+
assert.isFalse(fs.exists(path.join(appDestFolderPath, "app", "test2-js")).wait());
290290
assert.isFalse(fs.exists(path.join(appDestFolderPath, "app", "test1.js")).wait());
291291
assert.isFalse(fs.exists(path.join(appDestFolderPath, "app", "test1-js")).wait());
292292

0 commit comments

Comments
 (0)