Skip to content

Commit a76ac6e

Browse files
zoontekclaude
andcommitted
Resolve appPath in getInputFiles so "/Pods/" filter doesn't drop xcodeproj results
When appPath contains a "Pods/.." segment, every find result inherits that prefix and gets filtered out by the "/Pods/" exclusion. Normalize via path.resolve before invoking find so the segment is collapsed up front. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5eed812 commit a76ac6e

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

packages/react-native/scripts/codegen/generate-artifacts-executor/generateReactCodegenPodspec.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ function getInputFiles(appPath /*: string */, appPkgJson /*: $FlowFixMe */) {
4949
return '[]';
5050
}
5151

52+
// Normalize appPath so any "Pods/.." segment is collapsed before find runs.
53+
// Otherwise every find result inherits the search-root prefix containing
54+
// "/Pods/" and gets dropped by the exclusion filter below.
55+
const resolvedAppPath = path.resolve(appPath);
56+
5257
const xcodeproj = String(
53-
execSync(`find ${appPath} -type d -name "*.xcodeproj"`),
58+
execSync(`find ${resolvedAppPath} -type d -name "*.xcodeproj"`),
5459
)
5560
.trim()
5661
.split('\n')
@@ -61,12 +66,12 @@ function getInputFiles(appPath /*: string */, appPkgJson /*: $FlowFixMe */) {
6166
)[0];
6267
if (!xcodeproj) {
6368
throw new Error(
64-
`Cannot find .xcodeproj file inside ${appPath}. This is required to determine codegen spec paths relative to native project.`,
69+
`Cannot find .xcodeproj file inside ${resolvedAppPath}. This is required to determine codegen spec paths relative to native project.`,
6570
);
6671
}
6772
const jsFiles = '-name "Native*.js" -or -name "*NativeComponent.js"';
6873
const tsFiles = '-name "Native*.ts" -or -name "*NativeComponent.ts"';
69-
const findCommand = `find ${path.join(appPath, jsSrcsDir)} -type f -not -path "*/__mocks__/*" -and \\( ${jsFiles} -or ${tsFiles} \\)`;
74+
const findCommand = `find ${path.join(resolvedAppPath, jsSrcsDir)} -type f -not -path "*/__mocks__/*" -and \\( ${jsFiles} -or ${tsFiles} \\)`;
7075
const list = String(execSync(findCommand))
7176
.trim()
7277
.split('\n')

0 commit comments

Comments
 (0)