From 780fe80fcaf213d84d9d087132af933bd02d1349 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 10 Jun 2022 06:56:26 -0700 Subject: [PATCH] Don't validate ENTRY_FILE in react-native-xcode.sh (#32762) Summary: Reverts https://github.com/facebook/react-native/pull/29012 It is not really possible to properly validate if ENTRY_FILE exists since it is resolved by metro, and the server is not always running from the app root, like in a monorepo with multiple RN apps running on the same metro server. In my case I run metro on the repo root and entry file will be something like `apps/app/index.js`. `-f "$ENTRY_FILE"` will fail since the script is run from the project folder (`PROJECT_ROOT`, in my case the `apps/app` folder, so it tries to resolve `apps/app/apps/app/index.js`). I don't think this check is actually useful since metro will report the error if the entry file is invalid (fixed in https://github.com/facebook/react-native/pull/30150). The error is not as user friendly, but I think it is still fine. Maybe it could be improved in metro. ## Changelog [iOS] [Fixed] - Don't validate ENTRY_FILE in react-native-xcode.sh Pull Request resolved: https://github.com/facebook/react-native/pull/32762 Test Plan: Before image After if file is actually missing image After if file exists, builds successfully. Reviewed By: cortinico Differential Revision: D37066073 Pulled By: cipolleschi fbshipit-source-id: 8f6b149099a39d9179996bb965daa6cd9e06feac --- scripts/react-native-xcode.sh | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 6f95a2953c1223..1eca138eaf2fcb 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -74,11 +74,6 @@ 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 - # check and assign NODE_BINARY env # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" @@ -184,4 +179,4 @@ if [[ $DEV != true && ! -f "$BUNDLE_FILE" ]]; then echo "error: File $BUNDLE_FILE does not exist. This must be a bug with" >&2 echo "React Native, please report it here: https://github.com/facebook/react-native/issues" exit 2 -fi +fi \ No newline at end of file