From a065510ec8c88e108f0ca05da05c3f847b0ab68f Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Thu, 17 Dec 2015 14:09:40 -0800 Subject: [PATCH] Add support for nodenv with xcode Summary: Hello! I'm a fan of the *env family of version managers over the *vm family as I find them simpler and less obtrusive, but it seems that they don't currently work so well with react-native on OSX. See #4645 I've made a small addition to the xcode script that resolves the issue for me. Hopefully others will find this useful too :) If I've not made the right move here, what is the correct way to get react-native projects building in xcode when the binary is not in the $PATH used by the script? Cheers, Louis Closes https://github.com/facebook/react-native/pull/4801 Reviewed By: svcscm Differential Revision: D2770726 Pulled By: androidtrunkagent fb-gh-sync-id: 3b0f9e466549b3012a68c94738d2556173f4c21e --- react-native-xcode.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/react-native-xcode.sh b/react-native-xcode.sh index b0206be7..b655222f 100755 --- a/react-native-xcode.sh +++ b/react-native-xcode.sh @@ -41,6 +41,11 @@ elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then . "$(brew --prefix nvm)/nvm.sh" fi +# Set up the nodenv node version manager if present +if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then + eval "$($HOME/.nodenv/bin/nodenv init -)" +fi + react-native bundle \ --entry-file index.ios.js \ --platform ios \