Skip to content

Commit 39222b4

Browse files
blakefcipolleschi
authored andcommitted
autolinked package scripts use absolute path (#46186)
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
1 parent 2a567cb commit 39222b4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/react-native/scripts/cocoapods/autolinking.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def list_native_modules!(config_command)
7373
found_pods.push({
7474
"configurations": configurations,
7575
"name": name,
76+
"root": package["root"],
7677
"path": relative_path.to_path,
7778
"podspec_path": podspec_path,
7879
"script_phases": script_phases
@@ -168,7 +169,7 @@ def link_native_modules!(config)
168169

169170
# Support passing in a path relative to the root of the package
170171
if phase["path"]
171-
phase["script"] = File.read(File.expand_path(phase["path"], package[:path]))
172+
phase["script"] = File.read(File.expand_path(phase["path"], package[:root]))
172173
phase.delete("path")
173174
end
174175

0 commit comments

Comments
 (0)