Skip to content

Instantly share code, notes, and snippets.

@kazu69
Last active November 6, 2015 02:22
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 kazu69/7687f08c875694ee01c9 to your computer and use it in GitHub Desktop.
Save kazu69/7687f08c875694ee01c9 to your computer and use it in GitHub Desktop.
ndenv + gulp and local packages install shell
#!/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}"
@kazu69
Copy link
Author

kazu69 commented Oct 26, 2015

git clone git@gist.github.com:7687f08c875694ee01c9.git
cd 7687f08c875694ee01c9

chmod +w node_setup.sh
./node_setup.sh

node -v
v4.2.1

@kazu69
Copy link
Author

kazu69 commented Nov 6, 2015

npm i -g gulp
npm i

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment