File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -613,18 +613,17 @@ Put this into your `$HOME/.zshrc` to call `nvm use` automatically whenever you e
613613# place this after nvm initialization!
614614autoload -U add-zsh-hook
615615load-nvmrc () {
616- local node_version=" $( nvm version) "
617616 local nvmrc_path=" $( nvm_find_nvmrc) "
618617
619618 if [ -n " $nvmrc_path " ]; then
620619 local nvmrc_node_version=$( nvm version " $( cat " ${nvmrc_path} " ) " )
621620
622621 if [ " $nvmrc_node_version " = " N/A" ]; then
623622 nvm install
624- elif [ " $nvmrc_node_version " != " $node_version " ]; then
623+ elif [ " $nvmrc_node_version " != " $( nvm version ) " ]; then
625624 nvm use
626625 fi
627- elif [ " $node_version " != " $( nvm version default) " ]; then
626+ elif [ -n " $( PWD= $OLDPWD nvm_find_nvmrc ) " ] && [ " $( nvm version ) " != " $( nvm version default) " ]; then
628627 echo " Reverting to nvm default version"
629628 nvm use default
630629 fi
You can’t perform that action at this time.
0 commit comments