From 0b96bdcf326944b13e447f71739dee3c25c7b59a Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Fri, 23 Jun 2023 13:44:33 +0200 Subject: [PATCH] fix(ios): fix `pod install --project-directory=ios` failing (#37994) --- .../scripts/cocoapods/__tests__/codegen_utils-test.rb | 4 ++-- packages/react-native/scripts/cocoapods/codegen_utils.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb index aaa26cf9a5bc07..b039e64c327a8e 100644 --- a/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb +++ b/packages/react-native/scripts/cocoapods/__tests__/codegen_utils-test.rb @@ -373,7 +373,7 @@ def testUseReactCodegenDiscovery_whenParametersAreGood_executeCodegen '[Codegen] warn: using experimental new codegen integration' ]) assert_equal(codegen_utils_mock.get_react_codegen_script_phases_params, [{ - :app_path => "~/app", + :app_path => app_path, :config_file_dir => "", :config_key => "codegenConfig", :fabric_enabled => false, @@ -382,7 +382,7 @@ def testUseReactCodegenDiscovery_whenParametersAreGood_executeCodegen assert_equal(codegen_utils_mock.get_react_codegen_spec_params, [{ :fabric_enabled => false, :folly_version=>"2021.07.22.00", - :package_json_file => "../node_modules/react-native/package.json", + :package_json_file => "#{app_path}/ios/../node_modules/react-native/package.json", :script_phases => "echo TestScript" }]) assert_equal(codegen_utils_mock.generate_react_codegen_spec_params, [{ diff --git a/packages/react-native/scripts/cocoapods/codegen_utils.rb b/packages/react-native/scripts/cocoapods/codegen_utils.rb index f9f1549056b6de..5bff5c4c6ce7bc 100644 --- a/packages/react-native/scripts/cocoapods/codegen_utils.rb +++ b/packages/react-native/scripts/cocoapods/codegen_utils.rb @@ -313,7 +313,7 @@ def use_react_native_codegen_discovery!( :config_key => config_key ) react_codegen_spec = codegen_utils.get_react_codegen_spec( - file_manager.join(react_native_path, "package.json"), + file_manager.join(relative_installation_root, react_native_path, "package.json"), :folly_version => folly_version, :fabric_enabled => fabric_enabled, :hermes_enabled => hermes_enabled,