X-Git-Url: https://arthur.barton.de/gitweb/?a=blobdiff_plain;f=plugins%2Fhomebrew%2Fhomebrew.zprofile;h=df0c30c6aeb08b4b507973409bf55948466f786e;hb=b909201ca20803c83fdc14c7eb53b27264bb709c;hp=84cb740d0347bfcc6f29dafe79eae2d680b2d814;hpb=83aa52fc828392e74beffe94cfb0d2c1d1f1c35c;p=ax-zsh.git diff --git a/plugins/homebrew/homebrew.zprofile b/plugins/homebrew/homebrew.zprofile index 84cb740..df0c30c 100644 --- a/plugins/homebrew/homebrew.zprofile +++ b/plugins/homebrew/homebrew.zprofile @@ -1,10 +1,20 @@ # AX-ZSH: Alex' Modular ZSH Configuration # homebrew.zprofile -- Setup Homebrew Package Manager -# Make sure that "brew(1)" is installed -(( $+commands[brew] )) || return 1 +# Look for the "brew(1) command ... +for brew_cmd ( + /home/linuxbrew/.linuxbrew/bin/brew + /opt/homebrew/bin/brew + /usr/local/bin/brew +); do + [[ -x "$brew_cmd" ]] && break +done +if [[ ! -x "$brew_cmd" ]]; then + unset brew_cmd + return 1 +fi -eval "$(brew shellenv)" +eval "$("$brew_cmd" shellenv)" for dir ( "$HOMEBREW_PREFIX/share/zsh-completions" @@ -13,6 +23,6 @@ for dir ( [[ -d "$dir" ]] && axzsh_fpath+=("$dir") done -unset dir +unset dir brew_cmd return 0