Last active
November 6, 2015 02:22
-
-
Save kazu69/7687f08c875694ee01c9 to your computer and use it in GitHub Desktop.
ndenv + gulp and local packages install shell
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/sh | |
if [ -d $HOME/.ndenv ] | |
then | |
echo "$HOME/.ndenv already exists." | |
exit 1 | |
fi | |
git clone git@github.com:riywo/ndenv.git $HOME/.ndenv | |
mkdir -p $HOME/.ndenv/plugins | |
git clone git@github.com:riywo/node-build.git $HOME/.ndenv/plugins/node-build | |
SHNAME=`basename $SHELL` | |
if [ $SHNAME = 'bash' ]; then | |
CONF=$HOME/.bash_profile | |
COMPLETION=$HOME/.ndenv/completions/ndenv.bash | |
elif [ $SHNAME = 'zsh' ]; then | |
CONF=$HOME/.zshenv | |
COMPLETION=$HOME/.ndenv/completions/ndenv.zsh | |
fi | |
cat >> $CONF <<'_EOF_' | |
export PATH="$HOME/.ndenv/bin:$PATH" | |
eval "$(ndenv init -)" | |
_EOF_ | |
echo "source $COMPLETION" >> $CONF | |
source $CONF | |
NODE_VERSION=v4.2.1 | |
ndenv install $NODE_VERSION && ndenv global $NODE_VERSION | |
INSTALL_NODEVERSION=`node -v` | |
echo "install node version ${INSTALL_NODEVERSION}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git clone git@gist.github.com:7687f08c875694ee01c9.git cd 7687f08c875694ee01c9 chmod +w node_setup.sh ./node_setup.sh node -v v4.2.1