1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-12 00:40:07 +00:00

nvm: load nvm script only if command doesn't already exist (#5454)

Fixes #5453.
This commit is contained in:
Sascha Bratton 2019-04-08 11:58:27 -04:00 committed by Marc Cornellà
parent 9981479900
commit 728c8e7174

View file

@ -1,5 +1,8 @@
# Set NVM_DIR if it isn't already defined
[[ -z "$NVM_DIR" ]] && export NVM_DIR="$HOME/.nvm"
# Load nvm if it exists
[[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh"
# Try to load nvm only if command not already available
if ! type "nvm" &> /dev/null; then
# Load nvm if it exists
[[ -f "$NVM_DIR/nvm.sh" ]] && source "$NVM_DIR/nvm.sh"
fi