From bff358d88570461087ffbaf3913b75bd95044d98 Mon Sep 17 00:00:00 2001 From: charliie-dev Date: Fri, 25 Sep 2026 04:35:27 +0800 Subject: [PATCH] fix(homebrew): remove disabled eval-all flag from brewinfo Homebrew 7 rejects --eval-all on brew desc, so brewinfo fails before showing any formula descriptions. Use brew desc with the installed leaves directly and add a regression test for ordinary and fully-qualified tap formula names. --- plugins/homebrew/homebrew.plugin.zsh | 2 +- tests/bats/homebrew.bats | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/homebrew/homebrew.plugin.zsh b/plugins/homebrew/homebrew.plugin.zsh index 9b7f943..ea23ea6 100644 --- a/plugins/homebrew/homebrew.plugin.zsh +++ b/plugins/homebrew/homebrew.plugin.zsh @@ -56,7 +56,7 @@ unset _keg{,only} # Set aliases. if ! zstyle -t ':zephyr:plugin:homebrew:alias' skip; then alias brewup="brew update && brew upgrade && brew cleanup" - alias brewinfo="brew leaves | xargs brew desc --eval-all" + alias brewinfo="brew leaves | xargs brew desc" brewdeps() { emulate -L zsh; setopt local_options diff --git a/tests/bats/homebrew.bats b/tests/bats/homebrew.bats index 02e99f7..ceaa90f 100644 --- a/tests/bats/homebrew.bats +++ b/tests/bats/homebrew.bats @@ -106,6 +106,21 @@ EOS assert_line "brewdeps: 1" } +@test "brewinfo passes installed leaves to brew desc" { + stub_command brew " + case \$1 in + shellenv) print 'export HOMEBREW_PREFIX=$BREW_PREFIX' ;; + leaves) print -l foo example/tap/bar ;; + desc) print -r -- \"\$@\" ;; + *) exit 1 ;; + esac + " + # Expand the alias after the plugin has been sourced. + zephyr_plugin homebrew 'eval brewinfo' + assert_success + assert_line "desc foo example/tap/bar" +} + @test "the alias skip zstyle suppresses them" { zephyr_zsh <<'EOS' zstyle ':zephyr:plugin:homebrew:alias' skip yes