Skip to content

Commit 653f255

Browse files
committed
chore(template): dynamically resolve node modules root (#2757)
Followup from #2756 (comment)
1 parent 74c4147 commit 653f255

File tree

1 file changed

+8
-3
lines changed
  • packages/react-native/local-cli/generator-macos/templates/macos

1 file changed

+8
-3
lines changed

packages/react-native/local-cli/generator-macos/templates/macos/Podfile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
require_relative '../node_modules/react-native-macos/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
1+
require 'pathname'
2+
3+
ws_dir = Pathname.new(__dir__)
4+
ws_dir = ws_dir.parent until
5+
File.exist?("#{ws_dir}/node_modules/react-native-macos/scripts/react_native_pods.rb") ||
6+
ws_dir.expand_path.to_s == '/'
7+
require "#{ws_dir}/node_modules/react-native-macos/scripts/react_native_pods.rb"
38

49
prepare_react_native_project!
510

611
target 'HelloWorld-macOS' do
7-
platform :macos, '11.0'
12+
platform :macos, '14.0'
813
use_native_modules!
914

1015
# Flags change depending on the env values.

0 commit comments

Comments
 (0)