From dcecfa3189d7a71f57f908cc008e26c20a7cb2f5 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Mon, 3 Apr 2017 08:33:13 -0700 Subject: [PATCH] Make CLI executable configurable Summary: Follow up to #13248 for iOS. This pull request allows changing the default path to `cli` when running from Xcode environment. That is especially useful when debugging from a different location or... running `Haul`. Set `export CLI_PATH=./node_modules/react-native/local-cli/cli.js` and run. Should use new path provided. Closes https://github.com/facebook/react-native/pull/13264 Differential Revision: D4819059 Pulled By: ericvicenti fbshipit-source-id: 4a6241823c0bc8f1fa16869bc872bdbe04df510f --- packager/react-native-xcode.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packager/react-native-xcode.sh b/packager/react-native-xcode.sh index d136282fdd683d..6ef8f3e01297aa 100755 --- a/packager/react-native-xcode.sh +++ b/packager/react-native-xcode.sh @@ -55,6 +55,8 @@ fi [ -z "$NODE_BINARY" ] && export NODE_BINARY="node" +[ -z "$CLI_PATH" ] && export CLI_PATH="$REACT_NATIVE_DIR/local-cli/cli.js" + nodejs_not_found() { echo "error: Can't find '$NODE_BINARY' binary to build React Native bundle" >&2 @@ -85,7 +87,7 @@ fi BUNDLE_FILE="$DEST/main.jsbundle" -$NODE_BINARY "$REACT_NATIVE_DIR/local-cli/cli.js" bundle \ +$NODE_BINARY $CLI_PATH bundle \ --entry-file "$ENTRY_FILE" \ --platform ios \ --dev $DEV \