Improve zsh script to revert to default node version when exiting a .nvmrc directory.

Edward J. Jinotti 2016-04-28 10:49:13 -04:00
parent eb329ae7a9
commit 05a2d986a4
1 changed files with 3 additions and 0 deletions

View File

@ -199,6 +199,9 @@ autoload -U add-zsh-hook
load-nvmrc() {
if [[ -f .nvmrc && -r .nvmrc ]]; then
nvm use
elif [[ $(nvm version) != $(nvm version default) ]]; then
echo "Reverting to nvm default version"
nvm use default
fi
}
add-zsh-hook chpwd load-nvmrc