Skip to content

Instantly share code, notes, and snippets.

@imtapps
Created September 20, 2012 17:53
Show Gist options
  • Save imtapps/3757363 to your computer and use it in GitHub Desktop.
Save imtapps/3757363 to your computer and use it in GitHub Desktop.
Add node modules stuff to path in current shell
workon_node_env() {
current_dir=`pwd`
if [ -d "node_modules" ]; then
export ORIGINAL_PATH=$PATH
for f in `ls ${current_dir}/node_modules/`
do.
export PATH="${PATH}:${current_dir}/node_modules/${f}/bin"
done
deactivatenode(){
export PATH=$ORIGINAL_PATH
unset -f deactivatenode
}
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment