diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index f0cfa0fd54f..db8586c788e 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -78,9 +78,14 @@ 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} + ENTRY_FILE=${1:-index.ios.js} +else + ENTRY_FILE=${1:-index.js} +fi + +if [[ $DEV != true && ! -f "$ENTRY_FILE" ]]; then + echo "error: Entry file $ENTRY_FILE does not exist. If you use another file as your entry point, pass ENTRY_FILE=myindex.js" >&2 + exit 2 fi if [[ -s "$HOME/.nvm/nvm.sh" ]]; then