Created
September 20, 2012 17:53
-
-
Save imtapps/3757363 to your computer and use it in GitHub Desktop.
Add node modules stuff to path in current 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
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