From 585e7138b556db89715eb2a850f8959fdf527384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Regulski?= Date: Tue, 6 Dec 2022 18:22:13 +0100 Subject: [PATCH] fix(nvm): omit message when silent-autoload is enabled (#11371) --- plugins/nvm/nvm.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/nvm/nvm.plugin.zsh b/plugins/nvm/nvm.plugin.zsh index a4ff29cf1..20697d67d 100644 --- a/plugins/nvm/nvm.plugin.zsh +++ b/plugins/nvm/nvm.plugin.zsh @@ -65,7 +65,7 @@ if zstyle -t ':omz:plugins:nvm' autoload; then local node_version="$(nvm version)" local nvmrc_path="$(nvm_find_nvmrc)" local nvm_silent="" - zstyle -t ':omz:plugins:nvm' silent-autoload && _nvm_silent="--silent" + zstyle -t ':omz:plugins:nvm' silent-autoload && nvm_silent="--silent" if [[ -n "$nvmrc_path" ]]; then local nvmrc_node_version=$(nvm version $(cat "$nvmrc_path" | tr -dc '[:print:]')) @@ -76,7 +76,10 @@ if zstyle -t ':omz:plugins:nvm' autoload; then nvm use $nvm_silent fi elif [[ "$node_version" != "$(nvm version default)" ]]; then - echo "Reverting to nvm default version" + if [[ -z $nvm_silent ]]; then + echo "Reverting to nvm default version" + fi + nvm use default $nvm_silent fi }