- 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
This commit is contained in:
Takagi Kensuke
2019-01-15 16:11:10 -08:00
committed by Facebook Github Bot
parent 728a35fcf2
commit c3bbce449c

View File

@@ -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=""