Skip to content

Commit

Permalink
Better error message when missing entry file (#29012)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
petrbela authored and facebook-github-bot committed Jun 18, 2020
1 parent 3e5a7b2 commit e73208e
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e73208e

Please sign in to comment.