Skip to content

Commit

Permalink
fix: pod install with --project-directory (#35754)
Browse files Browse the repository at this point in the history
Summary:
The variable `version` is previously used but in 2344860#diff-adcf572f001c2b710d14f409c14763f1a50b08369b3034548f1602685d21f67f, its usage have been removed the but the variable is kept.

It also raises an error when using `bundle exec pod install --project-directory=ios` which works on `0.70.X` and below.

```txt
No such file or directory @ rb_sysopen - ../node_modules/react-native/package.json

/Users/davidangulo/Desktop/mobile/myapp/node_modules/react-native/scripts/react_native_pods.rb:212:in `read'
/Users/davidangulo/Desktop/mobile/myapp/node_modules/react-native/scripts/react_native_pods.rb:212:in `react_native_post_install'
```

## Changelog
[IOS] [FIXED] - pod install with --project-directory

Pull Request resolved: #35754

Test Plan: `bundle exec pod install --project-directory=ios` should not raise an error.

Reviewed By: christophpurrer

Differential Revision: D42298517

Pulled By: rshest

fbshipit-source-id: bef0b03312d2029188ae5437e3baf3ffce5cb73f
  • Loading branch information
dcangulo authored and facebook-github-bot committed Dec 31, 2022
1 parent 4923a09 commit efd39ee
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re
flipper_post_install(installer)
end

package = JSON.parse(File.read(File.join(react_native_path, "package.json")))
version = package['version']

ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer)
ReactNativePodsUtils.fix_library_search_paths(installer)
ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path)
Expand Down

0 comments on commit efd39ee

Please sign in to comment.