Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#85: fix _zsh_nvm_completion on macos homebrew. #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions zsh-nvm.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ _zsh_nvm_load() {
_zsh_nvm_completion() {

# Add provided nvm completion
[[ -r $NVM_DIR/bash_completion ]] && source $NVM_DIR/bash_completion
# default
if [[ -f "$NVM_DIR/bash_completion" ]]; then
source "$NVM_DIR/bash_completion"
# homebrew
elif _zsh_nvm_has brew && [[ -f "$(brew --prefix nvm)/etc/bash_completion.d/nvm" ]]; then
source "$(brew --prefix nvm)/etc/bash_completion.d/nvm"
fi
}

_zsh_nvm_lazy_load() {
Expand Down Expand Up @@ -218,7 +224,7 @@ if [[ "$ZSH_NVM_NO_LOAD" != true ]]; then

# Enable completion
[[ "$NVM_COMPLETION" == true ]] && _zsh_nvm_completion

# Auto use nvm on chpwd
[[ "$NVM_AUTO_USE" == true ]] && add-zsh-hook chpwd _zsh_nvm_auto_use && _zsh_nvm_auto_use
fi
Expand Down