fix(homebrew): wrap macOS version dependency in on_macos block

GoReleaser's Homebrew template always emits a bare `depends_on :macos`
for macOS-only formulae. Combining that with the `depends_on :macos =>
:ventura` line injected via custom_block triggers a Homebrew deprecation
warning on `brew upgrade`:

  Warning: Calling `depends_on :macos` with `depends_on macos:` is deprecated! Use `depends_on :macos` with `depends_on macos:` inside an `on_macos` block instead.
  Please report this issue to the cirruslabs/homebrew-cli tap (not Homebrew/* repositories), or even better, submit a PR to fix it:
    /opt/homebrew/Library/Taps/cirruslabs/homebrew-cli/tart.rb:22

Declaring the version constraint inside an `on_macos` block is the form
Homebrew recommends and silences the warning without changing behavior
(still macOS-only, Ventura or newer).
This commit is contained in:
Greg Hurrell 2026-06-10 12:22:50 +02:00
parent 0a01a4430c
commit a6da358da0
No known key found for this signature in database
GPG Key ID: C7761BC3DC609DF1
1 changed files with 3 additions and 1 deletions

View File

@ -72,7 +72,9 @@ brews:
libexec.install Dir["*"] libexec.install Dir["*"]
bin.write_exec_script "#{libexec}/tart.app/Contents/MacOS/tart" bin.write_exec_script "#{libexec}/tart.app/Contents/MacOS/tart"
custom_block: | custom_block: |
depends_on :macos => :ventura on_macos do
depends_on :macos => :ventura
end
def post_install def post_install
generate_completions_from_executable(libexec/"tart.app/Contents/MacOS/tart", "--generate-completion-script") generate_completions_from_executable(libexec/"tart.app/Contents/MacOS/tart", "--generate-completion-script")
end end