Created
June 16, 2018 03:57
-
-
Save nandub/ef8c6d73e511060635e6641142ad4083 to your computer and use it in GitHub Desktop.
Setup Nodenv Environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
arg=$1 | |
if [ "$arg" = "all" ]; then | |
nodenv-setup | |
nodenv install 4.8.4 | |
nodenv install 5.12.0 | |
nodenv install 6.14.2 | |
nodenv install 7.10.1 | |
nodenv install 8.11.1 | |
nodenv install 9.11.1 | |
exit | |
fi | |
if which nodenv > /dev/null; then | |
ROOT=$(nodenv root) | |
else | |
ROOT=~/.nodenv | |
fi | |
if [ "$arg" = "up" ]; then | |
pushd ${ROOT} && git pull && popd | |
folders=$(ls -1d ${ROOT}/plugins/*) | |
for dir in $folders | |
do | |
pushd $dir && git pull && popd | |
done | |
else | |
git clone https://github.com/nodenv/nodenv.git ${ROOT} | |
git clone https://github.com/nodenv/node-build.git ${ROOT}/plugins/node-build | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment