Skip to content

Commit

Permalink
[RN][iOS] autolinked package scripts use absolute path
Browse files Browse the repository at this point in the history
Summary:

A previous attempt at fixing this issue used a relative path (facebook#45208),
this doesn't work if the user runs bundle install outside of the ios/
folder, using the --project-directory=ios argument.

Changelog:
[iOS][Fix] support bundle install from outside the ios folder using --project-directory

Test Plan:
Ran the command in a project with @react-native-firebase/app using the
--project-directory, confirmed that it's fixed when using the absolute
path.

closes: reactwg/react-native-releases#341
  • Loading branch information
blakef committed Aug 23, 2024
1 parent 6b104bb commit 03a9c4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-native/scripts/cocoapods/autolinking.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def list_native_modules!(config_command)
found_pods.push({
"configurations": configurations,
"name": name,
"root": package["root"],
"path": relative_path.to_path,
"podspec_path": podspec_path,
"script_phases": script_phases
Expand Down Expand Up @@ -168,7 +169,7 @@ def link_native_modules!(config)

# Support passing in a path relative to the root of the package
if phase["path"]
phase["script"] = File.read(File.expand_path(phase["path"], package[:path]))
phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
phase.delete("path")
end

Expand Down

0 comments on commit 03a9c4f

Please sign in to comment.