Skip to content

Instantly share code, notes, and snippets.

@lucasmotta
Last active January 13, 2020 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasmotta/31aa4550abec303210f8c57b7ee16d5d to your computer and use it in GitHub Desktop.
Save lucasmotta/31aa4550abec303210f8c57b7ee16d5d to your computer and use it in GitHub Desktop.
Using react-native-config@0.11.7 with React Native >0.60
# This is needed for react-native-config
# See more: https://github.com/luggit/react-native-config/issues/187#issuecomment-468730417
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'react-native-config'
phase = target.project.new(Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
phase.shell_script = "cd ../../"\
" && RNC_ROOT=./node_modules/react-native-config/"\
" && export SYMROOT=$RNC_ROOT/ios/ReactNativeConfig"\
" && export BUILD_DIR=$RNC_ROOT/ios/ReactNativeConfig"\
" && ruby $RNC_ROOT/ios/ReactNativeConfig/BuildDotenvConfig.ruby"
target.build_phases << phase
target.build_phases.move(phase,0)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment