cli
cli copied to clipboard
use pod installed by bundler if possible
Summary
see https://github.com/react-native-community/cli/issues/2668 and https://github.com/react-native-community/cli/issues/2663 (should fix both).
This change ensures that local installed cocoapods (bundle exec pod) is used before system installed pod.
Test Plan
A: Bundled Version:
- make sure no cocoapods is not installed globally:
gem uninstall cocoapods npx @react-native-community/cli@latest init MyApp- press
nfor cocoa pods question cd MyAppbundle install
Now bundle exec pod --version has an 0 exit code.
npx react-native run-ios --force-pods will not fail nor install cocoapods globally (pod will have exit code > 0)
B: Global Version (someone could argue this should never be supported anyway):
- make sure cocoapods is installed globally:
gem install cocoapods npx @react-native-community/cli@latest init MyApp- press
nfor cocoa pods question cd MyApp- remove
cocoapodsfromGemfile bundle install
Now bundle exec pod --version has an non 0 exit code.
npx react-native run-ios --force-pods will not fail and install cocoapods globally (pod will have non 0 exit code)
Checklist
- [x] Documentation is up to date.
- [x] Follows commit message convention described in CONTRIBUTING.md.
- [x] For functional changes, my test plan has linked these CLI changes into a local
react-nativecheckout (instructions).