Skip to content

Commit 9c1ea45

Browse files
keatongrevefacebook-github-bot
authored andcommittedAug 21, 2018
Generate ip.txt before SKIP_BUNDLING check (#20554)
Summary: Fixes #20553. Re-applies the change as described in #16533, which was closed for being stale. Thanks to emusgrave for the original PR/change. Pull Request resolved: #20554 Differential Revision: D9414933 Pulled By: hramos fbshipit-source-id: 8ebca57e32b905c4ecfd661524ca415f51162545
1 parent 874cca1 commit 9c1ea45

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed
 

‎scripts/react-native-xcode.sh

+14-13
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@
88
# This script is supposed to be invoked as part of Xcode build process
99
# and relies on environment variables (including PWD) set by Xcode
1010

11+
# Print commands before executing them (useful for troubleshooting)
12+
set -x
13+
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
14+
15+
# Enables iOS devices to get the IP address of the machine running Metro Bundler
16+
if [[ "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
17+
IP=$(ipconfig getifaddr en0)
18+
if [ -z "$IP" ]; then
19+
IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\ -f2 | awk 'NR==1{print $1}')
20+
fi
21+
22+
echo "$IP" > "$DEST/ip.txt"
23+
fi
24+
1125
if [[ "$SKIP_BUNDLING" ]]; then
1226
echo "SKIP_BUNDLING enabled; skipping."
1327
exit 0;
@@ -90,19 +104,6 @@ nodejs_not_found()
90104

91105
type $NODE_BINARY >/dev/null 2>&1 || nodejs_not_found
92106

93-
# Print commands before executing them (useful for troubleshooting)
94-
set -x
95-
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
96-
97-
if [[ "$CONFIGURATION" = *Debug* && ! "$PLATFORM_NAME" == *simulator ]]; then
98-
IP=$(ipconfig getifaddr en0)
99-
if [ -z "$IP" ]; then
100-
IP=$(ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\ -f2 | awk 'NR==1{print $1}')
101-
fi
102-
103-
echo "$IP" > "$DEST/ip.txt"
104-
fi
105-
106107
BUNDLE_FILE="$DEST/main.jsbundle"
107108

108109
$NODE_BINARY "$CLI_PATH" $BUNDLE_COMMAND \

1 commit comments

Comments
 (1)

njleonzhang commented on Nov 12, 2018

@njleonzhang

why does this pr still not release?

Please sign in to comment.