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

Commit

Permalink
[config] Force entitlement paths to be in posix (#2841)
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric authored Nov 3, 2020
1 parent 0204b0b commit 186f155
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit 186f155

Please sign in to comment.