Created
February 7, 2017 03:58
-
-
Save dehamzah/59444e79c85e2e578845ac7be7c6e388 to your computer and use it in GitHub Desktop.
Add this to your .bashrc / .zshrc to automatically set node version that set in .nvmrc when changing directory
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
# Automatically switch to node version that set in .nvmrc | |
# if we change directory to that folder | |
cd() { | |
builtin cd "$@" | |
if [ -e ./.nvmrc ];then | |
{ | |
nvm use | |
} &> /dev/null | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment