mirror of
https://github.com/nvm-sh/nvm.git
synced 2025-05-10 22:31:51 +00:00
Improve zsh script to revert to default node version when exiting a .nvmrc directory.
This commit is contained in:
parent
eb329ae7a9
commit
05a2d986a4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user