Skip to content

Commit e73208e

Browse files
petrbelafacebook-github-bot
authored andcommitted
Better error message when missing entry file (#29012)
Summary: If the entry file has been renamed (e.g., to `index.ts`), the script currently fails silently and prints out that the bundle file does not exist. This change will print the correct error message instead. ## Changelog [iOS] [Fixed] - Better error message when missing entry file Pull Request resolved: #29012 Test Plan: N/A Reviewed By: hramos Differential Revision: D22109657 Pulled By: TheSavior fbshipit-source-id: edd7b6f88becc954ee41ed01ae43efb4481adc95
1 parent 3e5a7b2 commit e73208e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

scripts/react-native-xcode.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,14 @@ if [[ "$ENTRY_FILE" ]]; then
7878
# Use ENTRY_FILE defined by user
7979
:
8080
elif [[ -s "index.ios.js" ]]; then
81-
ENTRY_FILE=${1:-index.ios.js}
82-
else
83-
ENTRY_FILE=${1:-index.js}
81+
ENTRY_FILE=${1:-index.ios.js}
82+
else
83+
ENTRY_FILE=${1:-index.js}
84+
fi
85+
86+
if [[ $DEV != true && ! -f "$ENTRY_FILE" ]]; then
87+
echo "error: Entry file $ENTRY_FILE does not exist. If you use another file as your entry point, pass ENTRY_FILE=myindex.js" >&2
88+
exit 2
8489
fi
8590

8691
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then

0 commit comments

Comments
 (0)