Fix cask page rendering macOS requirements#2187
Conversation
When a cask has macOS requirements without specific version numbers, the page was rendering empty parentheses. This fix adds a check to only display the requirement if version information is present.
There was a problem hiding this comment.
Pull request overview
Fixes the cask page “Requirements” rendering when depends_on :macos is present but the generated JSON contains blank version entries (e.g., showing macOS >=).
Changes:
- Add a guard in the macOS requirements rendering loop to skip entries whose version list is effectively empty.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {%- capture requirements -%} | ||
| macOS {% for x in c.depends_on.macos -%} | ||
| {{ x.first | escape }} <strong>{{ c.depends_on.macos[x.first] | join: "</strong> / <strong>" }}</strong> | ||
| {%- unless forloop.last %} and {% endunless -%} | ||
| {%- assign versions = x.last | join: "" | strip -%} | ||
| {%- if versions.size > 0 -%} | ||
| {{ x.first | escape }} <strong>{{ c.depends_on.macos[x.first] | join: "</strong> / <strong>" }}</strong> | ||
| {%- unless forloop.last %} and {% endunless -%} | ||
| {%- endif -%} |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| {%- else -%} | ||
| macOS |
There was a problem hiding this comment.
I think that if depends_on :macos is specified, macOS needs to be added.
|
Does Homebrew/brew#22137 need merged first or second? |
If that one is merged first, this PR won't be needed. |
|
fixed via Homebrew/brew#22137 |
When a cask has macOS requirements without specific version numbers(with

depends_on :macos), the page was renderingRequirements: macOS >=such as https://formulae.brew.sh/cask/zed.This fix adds a check to only display the requirement if version information is present.
And, I think this is an issue with Brew, see Homebrew/brew#22137.