# https://github.com/nodenv/nodenv function install_nodenv { if command -v nodenv &> /dev/null; then echo "Nodenv is already installed." return 1 fi git clone https://github.com/nodenv/nodenv.git ${HOME}/.nodenv git clone https://github.com/nodenv/node-build.git ${HOME}/.nodenv/plugins/node-build } if [ -d "${HOME}/.nodenv" ]; then export PATH=${PATH}:${HOME}/.nodenv/bin eval "$(${HOME}/.nodenv/bin/nodenv init - bash)" fi