From cade63ed942f27d0134f1b6df50b99de50f9e8f1 Mon Sep 17 00:00:00 2001 From: Luke Childs Date: Sat, 27 Aug 2016 10:18:45 +0100 Subject: [PATCH] Add `NVM_LAZY_LOAD` option --- 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 feca270..4ed66d6 100644 --- a/zsh-nvm.plugin.zsh +++ b/zsh-nvm.plugin.zsh @@ -116,5 +116,9 @@ _zsh_nvm_revert() { # Install nvm if it isn't already installed [[ ! -f "$NVM_DIR/nvm.sh" ]] && _zsh_nvm_install -# If nvm is installed, load it -[[ -f "$NVM_DIR/nvm.sh" ]] && _zsh_nvm_load +# If nvm is installed +if [[ -f "$NVM_DIR/nvm.sh" ]]; then + + # Load it + [[ "$NVM_LAZY_LOAD" == true ]] && _zsh_nvm_lazy_load || _zsh_nvm_load +fi