From 8f682fafee3f3ea48f2c54ccaed5d2996c30affe Mon Sep 17 00:00:00 2001 From: Eric Henderson Date: Tue, 7 Jun 2022 13:36:27 -0400 Subject: [PATCH] further optimization --- zsh-nvm.plugin.zsh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zsh-nvm.plugin.zsh b/zsh-nvm.plugin.zsh index 79a5e16..cf03dfa 100644 --- a/zsh-nvm.plugin.zsh +++ b/zsh-nvm.plugin.zsh @@ -204,8 +204,12 @@ _zsh_nvm_auto_use() { nvm use && export NVM_AUTO_USE_ACTIVE=true fi elif [[ "$NVM_AUTO_USE_ACTIVE" != false ]] && [[ "$node_version" != "$(_nvm_default_version)" ]]; then - [[ "$NVM_AUTO_USE_ACTIVE" = true ]] && echo "Reverting to nvm default version" - nvm use default + if [[ "$NVM_AUTO_USE_ACTIVE" = true ]]; then + echo "Reverting to nvm default version" + nvm use default + else + nvm use default >/dev/null + fi fi }