From d92c1c6b01da7bd20e67071c70c2504e0e623f47 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:12:37 +0100 Subject: [PATCH] fix(apple): prepare `react-native-codegen` when using main --- ios/use_react_native-0.64.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ios/use_react_native-0.64.rb b/ios/use_react_native-0.64.rb index f24066dea..4dd899c25 100644 --- a/ios/use_react_native-0.64.rb +++ b/ios/use_react_native-0.64.rb @@ -1,3 +1,5 @@ +require 'open3' + def include_react_native!(options) react_native, flipper_versions, project_root, target_platform = options.values_at( :path, :rta_flipper_versions, :rta_project_root, :rta_target_platform @@ -8,6 +10,11 @@ def include_react_native!(options) use_flipper!(flipper_versions) if target_platform == :ios && flipper_versions use_react_native!(options) + # If we're using react-native@main, we'll also need to prepare + # `react-native-codegen`. + codegen = File.join(project_root, react_native, 'packages', 'react-native-codegen') + Open3.popen3('yarn', :chdir => codegen) if File.directory?(codegen) + lambda { |installer| react_native_post_install(installer) if defined?(__apply_Xcode_12_5_M1_post_install_workaround)