]> arthur.barton.de Git - ax-zsh.git/commitdiff
homebrew: Make sure brew(1) command actually works
authorAlexander Barton <alex@barton.de>
Mon, 13 Dec 2021 10:00:02 +0000 (11:00 +0100)
committerAlexander Barton <alex@barton.de>
Mon, 13 Dec 2021 10:00:02 +0000 (11:00 +0100)
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.

plugins/homebrew/homebrew.zprofile

index 84cb740d0347bfcc6f29dafe79eae2d680b2d814..f59d43edab86d9c1e77cafae23dd7b393cf8904a 100644 (file)
@@ -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 (