diff --git a/packages/react-native/local-cli/generator-macos/templates/macos/Podfile b/packages/react-native/local-cli/generator-macos/templates/macos/Podfile index 962710a5eb630b..f2e9f753243191 100644 --- a/packages/react-native/local-cli/generator-macos/templates/macos/Podfile +++ b/packages/react-native/local-cli/generator-macos/templates/macos/Podfile @@ -1,15 +1,15 @@ -autolinking_script = File.expand_path('../node_modules/react-native-macos/scripts/cocoapods/autolinking.rb', __dir__) -if File.exist?(autolinking_script) - require_relative '../node_modules/react-native-macos/scripts/cocoapods/autolinking' -else - require_relative '../node_modules/react-native-macos/scripts/react_native_pods' - require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -end +require 'pathname' + +ws_dir = Pathname.new(__dir__) +ws_dir = ws_dir.parent until + File.exist?("#{ws_dir}/node_modules/react-native-macos/scripts/react_native_pods.rb") || + ws_dir.expand_path.to_s == '/' +require "#{ws_dir}/node_modules/react-native-macos/scripts/react_native_pods.rb" prepare_react_native_project! target 'HelloWorld-macOS' do - platform :macos, '11.0' + platform :macos, '14.0' use_native_modules! # Flags change depending on the env values.