Skip to content

Instantly share code, notes, and snippets.

@JuneKelly
Created December 26, 2019 21:22
Show Gist options
  • Save JuneKelly/11a91a250f5ab8831403a8c9e2b422e8 to your computer and use it in GitHub Desktop.
Save JuneKelly/11a91a250f5ab8831403a8c9e2b422e8 to your computer and use it in GitHub Desktop.
Zsh nvm wrapper
export NVM_DIR="$HOME/.nvm"
function nvm() {
if [[ -v __nvm_recursion_protect__ ]]; then
echo 'error: recursive call to nvm'
return 1
fi
local __nvm_recursion_protect__='true'
if [[ "$(type nvm)" =~ 'zshrc' ]]; then
source "$NVM_DIR/nvm.sh"
source "$NVM_DIR/bash_completion"
fi
nvm $@
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment