Skip to content

Commit

Permalink
autolinked package scripts use absolute path (#46186)
Browse files Browse the repository at this point in the history
Summary:
A previous attempt at fixing this issue used a relative path (#45208), this doesn't work if the user runs bundle install outside of the `ios/`
folder, using the `--project-directory=ios` argument.

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

Pull Request resolved: #46186

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

Reviewed By: cipolleschi

Differential Revision: D61719821

Pulled By: blakef

fbshipit-source-id: d83429dd29c9e8cc066ab9843ad95fdfc0af8dea
  • Loading branch information
blakef authored and facebook-github-bot committed Aug 23, 2024
1 parent d7a3e48 commit b22970e
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 b22970e

Please sign in to comment.