From 0964135a178b459e06b44a49a4ecb0dd6c5bec9b Mon Sep 17 00:00:00 2001 From: Sho Ikeda Date: Fri, 1 Jun 2018 15:56:49 -0700 Subject: [PATCH] react-native-xcode.sh: Support Homebrew-installed nodenv Summary: As well as nvm. https://github.com/facebook/react-native/blob/9d315f4a1e7b0c9cd80a51903db0b1b561b19e33/scripts/react-native-xcode.sh#L56-L60 Build React Native iOS app with Release configuration and run the script using `node` command which is installed through Homebrew-installed `nodenv` and `node-build`. None. [IOS] [ENHANCEMENT] [scripts/react-native-xcode.sh] - Support Homebrew-installed nodenv Closes https://github.com/facebook/react-native/pull/19509 Differential Revision: D8243181 Pulled By: hramos fbshipit-source-id: fbd75f377f4aebf89ce35b96a47c59238e62e9ce --- scripts/react-native-xcode.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 1e2597412..7194c2a18 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -62,6 +62,8 @@ fi # Set up the nodenv node version manager if present if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then eval "$("$HOME/.nodenv/bin/nodenv" init -)" +elif [[ -x "$(command -v brew)" && -x "$(brew --prefix nodenv)/bin/nodenv" ]]; then + eval "$("$(brew --prefix nodenv)/bin/nodenv" init -)" fi [ -z "$NODE_BINARY" ] && export NODE_BINARY="node"