Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[config] Force ios entitlement paths to be in posix #2841

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"require-from-string": "^2.0.2",
"resolve-from": "^5.0.0",
"semver": "^7.1.3",
"slash": "^3.0.0",
"slugify": "^1.3.4",
"xcode": "^2.1.0",
"xml2js": "^0.4.23"
Expand Down
10 changes: 7 additions & 3 deletions packages/config/src/ios/Entitlements.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import fs from 'fs-extra';
import path from 'path';
import slash from 'slash';

import { ExpoConfig } from '../Config.types';
import { addWarningIOS } from '../WarningAggregator';
Expand Down Expand Up @@ -101,13 +102,16 @@ export function getEntitlementsPath(projectRoot: string): string {
const projectName = getProjectName(projectRoot);
const productName = getProductName(project);

const entitlementsRelativePath = path.join(projectName, `${productName}.entitlements`);
const entitlementsPath = path.normalize(path.join(projectRoot, 'ios', entitlementsRelativePath));
// Use posix formatted path, even on Windows
const entitlementsRelativePath = slash(path.join(projectName, `${productName}.entitlements`));
const entitlementsPath = slash(
path.normalize(path.join(projectRoot, 'ios', entitlementsRelativePath))
);

const pathsToDelete: string[] = [];

while (paths.length) {
const last = path.normalize(paths.pop()!);
const last = slash(path.normalize(paths.pop()!));
if (last !== entitlementsPath) {
pathsToDelete.push(last);
} else {
Expand Down