Skip to content

Commit

Permalink
fix: add more guard conditions for retrieving buildConfig from XcSche…
Browse files Browse the repository at this point in the history
…me (#2196)

* fix: add more guard conditions for retrieving buildConfig from XcScheme

* fix: mark unused variable as _

* fix: revert code and add more info
  • Loading branch information
AnnatarHe authored Dec 18, 2023
1 parent 1e6ea84 commit 2fc5965
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ export function getBuildConfigurationFromXcScheme(
sourceDir: string,
projectInfo: IosInfo | undefined,
): string {
// can not assume .xcodeproj exists.
// for more info see: https://github.com/react-native-community/cli/pull/2196
try {
const xcProject = fs
.readdirSync(sourceDir)
.find((dir) => dir.includes('.xcodeproj'));
.find((dir) => dir.endsWith('.xcodeproj'));

if (xcProject) {
const xmlScheme = fs.readFileSync(
Expand Down

0 comments on commit 2fc5965

Please sign in to comment.