From 22b3528e7b5679ca34436bc032e6f1f1630d3c07 Mon Sep 17 00:00:00 2001 From: Bruno Lemos Date: Wed, 27 Feb 2019 13:30:50 -0800 Subject: [PATCH] - Allow overriding ENTRY_FILE on react-native-xcode.sh script (#23667) Summary: 1. Feature parity with Android, that already have this extensibility point on `build.gradle`: https://github.com/facebook/react-native/blob/7c9805ce163c5a027da2b8458e87d9b582ba9ba6/react.gradle#L12 2. Helps with using react-native on a monorepo project (yarn workspaces) without having to use the no-hoist feature (e.g. in my case the `ENTRY_FILE` is on `root/packages/mobile/index.js` instead of `root/index.ios.js`) [iOS] [Added] - Allow overriding ENTRY_FILE on react-native-xcode.sh script Pull Request resolved: https://github.com/facebook/react-native/pull/23667 Differential Revision: D14247236 Pulled By: hramos fbshipit-source-id: 2f678c65eb898fc04549ab738b62e5864d753afd --- scripts/react-native-xcode.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index d684e89f8dc..3848f0624cd 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -63,10 +63,13 @@ cd $PROJECT_ROOT [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" # Define entry file -if [[ -s "index.ios.js" ]]; then - ENTRY_FILE=${1:-index.ios.js} -else - ENTRY_FILE=${1:-index.js} +if [[ "$ENTRY_FILE" ]]; then + # Use ENTRY_FILE defined by user + : +elif [[ -s "index.ios.js" ]]; then + ENTRY_FILE=${1:-index.ios.js} + else + ENTRY_FILE=${1:-index.js} fi if [[ -s "$HOME/.nvm/nvm.sh" ]]; then