Skip to content

Commit 0b96bdc

Browse files
authored
fix(ios): fix pod install --project-directory=ios failing (#37994)
1 parent 7a893e4 commit 0b96bdc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def testUseReactCodegenDiscovery_whenParametersAreGood_executeCodegen
373373
'[Codegen] warn: using experimental new codegen integration'
374374
])
375375
assert_equal(codegen_utils_mock.get_react_codegen_script_phases_params, [{
376-
:app_path => "~/app",
376+
:app_path => app_path,
377377
:config_file_dir => "",
378378
:config_key => "codegenConfig",
379379
:fabric_enabled => false,
@@ -382,7 +382,7 @@ def testUseReactCodegenDiscovery_whenParametersAreGood_executeCodegen
382382
assert_equal(codegen_utils_mock.get_react_codegen_spec_params, [{
383383
:fabric_enabled => false,
384384
:folly_version=>"2021.07.22.00",
385-
:package_json_file => "../node_modules/react-native/package.json",
385+
:package_json_file => "#{app_path}/ios/../node_modules/react-native/package.json",
386386
:script_phases => "echo TestScript"
387387
}])
388388
assert_equal(codegen_utils_mock.generate_react_codegen_spec_params, [{

packages/react-native/scripts/cocoapods/codegen_utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def use_react_native_codegen_discovery!(
313313
:config_key => config_key
314314
)
315315
react_codegen_spec = codegen_utils.get_react_codegen_spec(
316-
file_manager.join(react_native_path, "package.json"),
316+
file_manager.join(relative_installation_root, react_native_path, "package.json"),
317317
:folly_version => folly_version,
318318
:fabric_enabled => fabric_enabled,
319319
:hermes_enabled => hermes_enabled,

0 commit comments

Comments
 (0)