Skip to content

Commit b1c6f18

Browse files
Fix tns run ios on case sensitive file system (#3045)
In case the file system is case sensitive, `tns run ios` command fails to execute as the `entitlements` file from `app/App_Resources/iOS/` (in case there's such file) is copied to `<project dir>/platforms/ios` dir (the name of iOS dir inside platforms is lowercased). However the entitlements service expects it to be inside `<project dir>/platforms/iOS` dir. On case sensitive file systems we fail with ENOENT error, as there's no iOS directory. Fix this inside `entitlements service` to use lowercased value. This way it will successfully find the entitlements file inside platforms dir.
1 parent 81488de commit b1c6f18

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

lib/services/ios-entitlements-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class IOSEntitlementsService {
2222
}
2323

2424
public getPlatformsEntitlementsPath(projectData: IProjectData) : string {
25-
return path.join(projectData.platformsDir, this.$devicePlatformsConstants.iOS,
25+
return path.join(projectData.platformsDir, this.$devicePlatformsConstants.iOS.toLowerCase(),
2626
projectData.projectName, projectData.projectName + ".entitlements");
2727
}
2828
public getPlatformsEntitlementsRelativePath(projectData: IProjectData): string {

test/ios-entitlements-service.ts

+6
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ describe("IOSEntitlements Service Tests", () => {
6464
let actual = iOSEntitlementsService.getPlatformsEntitlementsRelativePath(projectData);
6565
assert.equal(actual, expected);
6666
});
67+
68+
it("Ensure full path to entitlements in platforms dir is correct", () => {
69+
const expected = path.join(projectData.platformsDir, "ios", "testApp", "testApp.entitlements");
70+
const actual = iOSEntitlementsService.getPlatformsEntitlementsPath(projectData);
71+
assert.equal(actual, expected);
72+
});
6773
});
6874

6975
describe("Merge", () => {

0 commit comments

Comments
 (0)