mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-11 09:11:14 +08:00
Handle spaces in $REACT_NATIVE_DIR
Summary:
`react-native-xcode.sh` can fail to execute if `$REACT_NATIVE_DIR` contains spaces.
E.g. if `$REACT_NATIVE_DIR` was `/Users/samn/src/Xcode Projects/AwesomeReact` then `react-native-xcode.sh` would fail with the following error:
```
node /Users/samn/src/Xcode Projects/ReactNativeBeaconTest/node_modules/react-native/local-cli/cli.js bundle .... (elided)
module.js:341
throw err;
^
Error: Cannot find module '/Users/samn/src/Xcode'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)
at Function.Module.runMain (module.js:447:10)
at startup (node.js:139:18)
at node.js:999:3
Command /bin/sh failed with exit code 1
```
This change properly handles paths with spaces in them by quoting `$REACT_NATIVE_DIR`
Closes https://github.com/facebook/react-native/pull/5651
Reviewed By: svcscm
Differential Revision: D2884600
Pulled By: androidtrunkagent
fb-gh-sync-id: 3784d8f4e16c0c2cadac738c5f085a5023b5ecf7
This commit is contained in:
committed by
facebook-github-bot-9
parent
5712e0c3eb
commit
23412459b2
@@ -68,7 +68,7 @@ type $NODE_BINARY >/dev/null 2>&1 || nodejs_not_found
|
||||
set -x
|
||||
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
|
||||
|
||||
$NODE_BINARY $REACT_NATIVE_DIR/local-cli/cli.js bundle \
|
||||
$NODE_BINARY "$REACT_NATIVE_DIR/local-cli/cli.js" bundle \
|
||||
--entry-file index.ios.js \
|
||||
--platform ios \
|
||||
--dev $DEV \
|
||||
|
||||
Reference in New Issue
Block a user