Skip to content

Commit 27fb93c

Browse files
committed
fix: paths in packageIos in RN projects
1 parent 0f6d0b6 commit 27fb93c

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

packages/cli/src/brownfield/commands/packageIos.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,21 @@ export const packageIosCommand = curryOptions(
5050
throw new Error('iOS Xcode project not found in the configuration.');
5151
}
5252

53-
const dotBrownfieldDir = path.join(
54-
userConfig.project.ios.sourceDir,
53+
let dotBrownfieldDir = path.join(
54+
// for Expo projects, platformConfig?.sourceDir == "", but for non-Expo projects, it's "ios"
55+
...(userConfig.project.ios.sourceDir.trim().length > 0
56+
? [userConfig.project.ios.sourceDir]
57+
: [projectRoot, 'ios']),
5558
'.brownfield'
5659
);
5760

61+
// non-Expo projects have a relative sourceDir path, so we need to make it absolute
62+
if (!path.isAbsolute(dotBrownfieldDir)) {
63+
dotBrownfieldDir = path.join(projectRoot, dotBrownfieldDir);
64+
}
65+
5866
options.buildFolder ??= path.join(dotBrownfieldDir, 'build');
67+
5968
// The new_architecture.rb script scans Info.plist and fails on binary plist files,
6069
// which is the case for our XCFrameworks.
6170
// We're reusing the "build" directory which is excluded from the scan.

0 commit comments

Comments
 (0)