Skip to content

Commit 2fc5965

Browse files
authored
fix: add more guard conditions for retrieving buildConfig from XcScheme (#2196)
* fix: add more guard conditions for retrieving buildConfig from XcScheme * fix: mark unused variable as _ * fix: revert code and add more info
1 parent 1e6ea84 commit 2fc5965

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/cli-platform-ios/src/tools/getBuildConfigurationFromXcScheme.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ export function getBuildConfigurationFromXcScheme(
1313
sourceDir: string,
1414
projectInfo: IosInfo | undefined,
1515
): string {
16+
// can not assume .xcodeproj exists.
17+
// for more info see: https://github.com/react-native-community/cli/pull/2196
1618
try {
1719
const xcProject = fs
1820
.readdirSync(sourceDir)
19-
.find((dir) => dir.includes('.xcodeproj'));
21+
.find((dir) => dir.endsWith('.xcodeproj'));
2022

2123
if (xcProject) {
2224
const xmlScheme = fs.readFileSync(

0 commit comments

Comments
 (0)