From 876f581c067d6da11a72700d9833327eb27ab28c Mon Sep 17 00:00:00 2001 From: jjd314 Date: Tue, 4 Aug 2020 08:33:02 -0400 Subject: [PATCH] Update README.md, correct iOS build pre-action (#475) There's a comment as part of the review of pull request #281 by @danielwinkler that the build pre-action for iOS should copy the .env.staging (or whatever) file to ${PROJECT_DIR}/../.env, which turns out to be correct. This change updates the README to reflect that (and also addresses his other comment about the second reference to /tmp/envfile). @maharjanaman also mentioned on that pull request a problem with the script, and I believe that was from not having a "Provide build settings from" selection, so I added a comment about that, as well. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ee3dba..688b7fc 100644 --- a/README.md +++ b/README.md @@ -181,7 +181,7 @@ ios/tmp.xcconfig 4. go to project settings 5. apply config to your configurations ![img](./readme-pics/3.ios_apply_config.png) -6. create new build phase for the scheme which will generate "tmp.xcconfig" before each build exposing values to Build Settings and Info.plist (this snippet has to be placed after "echo ... > tmp/envfile" if [approach explained below](#ios-multi-scheme) is used) +6. create new build phase for the scheme which will generate "tmp.xcconfig" before each build exposing values to Build Settings and Info.plist (this snippet has to be placed after "cp ... ${PROJECT_DIR}/../.env" if [approach explained below](#ios-multi-scheme) is used) ``` "${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildXCConfig.rb" "${SRCROOT}/.." "${SRCROOT}/tmp.xcconfig" @@ -256,8 +256,9 @@ Then edit the newly created scheme to make it use a different env file. From the - Click "Pre-actions", and under the plus sign select "New Run Script Action" - Where it says "Type a script or drag a script file", type: ``` - cp ${PROJECT_DIR}/../.env.staging .env # replace .env.staging for your file + cp ${PROJECT_DIR}/../.env.staging ${PROJECT_DIR}/../.env # replace .env.staging for your file ``` +Also ensure that "Provide build settings from", just above the script, has a value selected so that PROJECT_DIR is set. ## Troubleshooting