From c3bbce449cad238be264d8c74dda981dbee65356 Mon Sep 17 00:00:00 2001 From: Takagi Kensuke Date: Tue, 15 Jan 2019 16:11:10 -0800 Subject: [PATCH] - Fix failing to bundle in Release build with ndenv of anyenv by supporting anyenv (#22875) Summary: refer: https://github.com/riywo/anyenv Changelog: ---------- [iOS] [Fixed] - Fix failing to bundle in Release build with ndenv of anyenv by supporting anyenv Pull Request resolved: https://github.com/facebook/react-native/pull/22875 Differential Revision: D13682773 Pulled By: hramos fbshipit-source-id: 0baacc95bd215d4724ba418ff187d51b11126326 --- scripts/react-native-xcode.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index e7bbec599b9..8bb6caaf959 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -80,6 +80,14 @@ elif [[ -x "$(command -v brew)" && -x "$(brew --prefix nodenv)/bin/nodenv" ]]; t eval "$("$(brew --prefix nodenv)/bin/nodenv" init -)" fi +# Set up the ndenv of anyenv if preset +if [[ ! -x node && -d ${HOME}/.anyenv/bin ]]; then + export PATH=${HOME}/.anyenv/bin:${PATH} + if [[ "$(anyenv envs | grep -c ndenv )" -eq 1 ]]; then + eval "$(anyenv init -)" + fi +fi + [ -z "$NODE_BINARY" ] && export NODE_BINARY="node" [ -z "$NODE_ARGS" ] && export NODE_ARGS=""