]> arthur.barton.de Git - ax-zsh.git/blobdiff - plugins/homebrew/homebrew.zprofile
homebrew: Fix detection of Homebrew command completions
[ax-zsh.git] / plugins / homebrew / homebrew.zprofile
index 5885efdb57b3720f80f9e10c7a502db94924e984..84cb740d0347bfcc6f29dafe79eae2d680b2d814 100644 (file)
@@ -4,7 +4,15 @@
 # Make sure that "brew(1)" is installed
 (( $+commands[brew] )) || return 1
 
-[[ -d "/usr/local/share/zsh-completions" ]] \
-       && axzsh_fpath+=(/usr/local/share/zsh-completions)
+eval "$(brew shellenv)"
+
+for dir (
+       "$HOMEBREW_PREFIX/share/zsh-completions"
+       "$HOMEBREW_PREFIX/share/zsh/site-functions"
+); do
+       [[ -d "$dir" ]] && axzsh_fpath+=("$dir")
+
+done
+unset dir
 
 return 0