From fd53324509ce676f68c662c6f85866e43f1ae1c7 Mon Sep 17 00:00:00 2001 From: Lucas Araujo Date: Mon, 25 Dec 2017 13:47:32 -0200 Subject: [PATCH] Add NVM_AUTO_REVERT option when using AUTO_USE --- zsh-nvm.plugin.zsh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zsh-nvm.plugin.zsh b/zsh-nvm.plugin.zsh index a672ed7..6c79dea 100644 --- a/zsh-nvm.plugin.zsh +++ b/zsh-nvm.plugin.zsh @@ -60,6 +60,7 @@ _zsh_nvm_load() { 'use') _zsh_nvm_nvm "$@" export NVM_AUTO_USE_ACTIVE=false + export NVM_AUTO_REVERT=false ;; 'install' | 'i') _zsh_nvm_install_wrapper "$@" @@ -169,7 +170,7 @@ _zsh_nvm_auto_use() { elif [[ "$nvmrc_node_version" != "$node_version" ]]; then nvm use && export NVM_AUTO_USE_ACTIVE=true fi - elif [[ "$node_version" != "$(nvm version default)" ]] && [[ "$NVM_AUTO_USE_ACTIVE" = true ]]; then + elif [[ "$node_version" != "$(nvm version default)" ]] && [[ "$NVM_AUTO_USE_ACTIVE" = true ]] && [[ "$NVM_AUTO_REVERT" = true ]]; then echo "Reverting to nvm default version" nvm use default fi