From 05a2d986a439c77122d4d4def70d5b539bc1cb18 Mon Sep 17 00:00:00 2001 From: "Edward J. Jinotti" Date: Thu, 28 Apr 2016 10:49:13 -0400 Subject: [PATCH] Improve zsh script to revert to default node version when exiting a .nvmrc directory. --- README.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.markdown b/README.markdown index 4999302..007ecfc 100644 --- a/README.markdown +++ b/README.markdown @@ -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