From: Alexander Barton Date: Mon, 13 Dec 2021 10:00:02 +0000 (+0100) Subject: homebrew: Make sure brew(1) command actually works X-Git-Url: https://arthur.ath.cx/gitweb/?a=commitdiff_plain;h=f4ec5285ead2b4182a7e96ca90d9d4b5ddb9c65c;p=ax-zsh.git homebrew: Make sure brew(1) command actually works There are wrapper scripts out there -- at least my own ;-) -- which are available even on systems where no "real" brew is available, and therefore this wrapper errors our when called. So not only check for brew's existence, but if it is working when checking for plugins. --- diff --git a/plugins/homebrew/homebrew.zprofile b/plugins/homebrew/homebrew.zprofile index 84cb740..f59d43e 100644 --- a/plugins/homebrew/homebrew.zprofile +++ b/plugins/homebrew/homebrew.zprofile @@ -4,6 +4,11 @@ # Make sure that "brew(1)" is installed (( $+commands[brew] )) || return 1 +if [[ -n "$AXZSH_PLUGIN_CHECK" ]]; then + # Make sure brew command is working + brew --version >/dev/null 2>&1 || return 1 +fi + eval "$(brew shellenv)" for dir (