Fix nvm plugin to use also check brew installs.

This commit is contained in:
Blaine Schmeisser 2016-07-13 13:08:16 -07:00
commit 5d391f0955
No known key found for this signature in database
GPG key ID: 0519B8F98D515E0C
2 changed files with 9 additions and 3 deletions

View file

@ -1,7 +1,9 @@
#compdef nvm
#autoload
[[ -s ~/.nvm/nvm.sh ]] || return 0
if ![ -f $HOME/.nvm/nvm.sh ] && ![ $commands[brew] -a -f `brew --prefix`/opt/nvm/nvm.sh ]; then
return 0
fi
local -a _1st_arguments
_1st_arguments=(
@ -23,4 +25,4 @@ _arguments -C '*:: :->subcmds' && return 0
if (( CURRENT == 1 )); then
_describe -t commands "nvm subcommand" _1st_arguments
return
fi
fi

View file

@ -1,3 +1,7 @@
# The addition 'nvm install' attempts in ~/.profile
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh
if [ -f $HOME/.nvm/nvm.sh ]; then # manual user-local installation
. ~/.nvm/nvm.sh
elif [ $commands[brew] -a -f `brew --prefix`/opt/nvm/nvm.sh ]; then # mac os x with brew
. $(brew --prefix)/opt/nvm/nvm.sh
fi