Permalink
Browse files

Check bundle file exists for release builds

Summary:
Motivation: While testing the RC, the bundle step failed (because the reset-cache true flag was still present) for an Archive build causing an app to be distributed without the JS bundle. This was obviously not great because the app just crashed on startup.

This fix just checks that the bundle file is present and if not fails the build, as you would expect it to.
Closes #9284

Differential Revision: D3749572

fbshipit-source-id: f1ccb8b6cd0b78f6d8267e7b4b0f10b4a3cec5a1
  • Loading branch information...
1 parent 004135a commit ea7b2ef36b1a0b141c4b64d0ab5d6d3a94be14a4 @alexanderjarvis alexanderjarvis committed with Facebook Github Bot 4 Aug 21, 2016
Showing with 9 additions and 1 deletion.
  1. +9 −1 packager/react-native-xcode.sh
@@ -80,10 +80,18 @@ if [[ "$CONFIGURATION" = "Debug" && "$PLATFORM_NAME" != "iphonesimulator" ]]; th
echo "$IP.xip.io" > "$DEST/ip.txt"
fi
+BUNDLE_FILE="$DEST/main.jsbundle"
+
$NODE_BINARY "$REACT_NATIVE_DIR/local-cli/cli.js" bundle \
--entry-file "$ENTRY_FILE" \
--platform ios \
--dev $DEV \
--reset-cache \
- --bundle-output "$DEST/main.jsbundle" \
+ --bundle-output "$BUNDLE_FILE" \
--assets-dest "$DEST"
+
+if [[ ! $DEV && ! -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

0 comments on commit ea7b2ef

Please sign in to comment.