Skip to content

Instantly share code, notes, and snippets.

@nandub
Created June 16, 2018 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nandub/ef8c6d73e511060635e6641142ad4083 to your computer and use it in GitHub Desktop.
Save nandub/ef8c6d73e511060635e6641142ad4083 to your computer and use it in GitHub Desktop.
Setup Nodenv Environment
#!/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