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
This commit is contained in:
Mike Grabowski 2017-04-03 08:33:13 -07:00 committed by Facebook Github Bot
parent cc2ec6ff07
commit dcecfa3189
1 changed files with 3 additions and 1 deletions

View File

@ -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 \