-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Add installed and outdated to cask json output #10278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Library/Homebrew/cask/cask.rb
Outdated
"url" => url, | ||
"appcast" => appcast, | ||
"version" => version, | ||
"installed" => versions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a boolean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to match the keys with formula.rb which lists installed kegs with the installed
key. I see why it makes sense as a boolean though. How about changing it to a boolean, and then adding "installed_versions" => versions
to provide additional details?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing it to a boolean, and then adding
"installed_versions" => versions
to provide additional details?
You can’t have more than one version of a cask installed at once—that would make no sense for most casks. So just the boolean, and no further details necessary.
Any suggestions regarding using |
Hi, I wanted to give a better description of this request and why it's needed. I think I should have opened an issue first to discuss before submitting the PR (sorry! first time contributing to open source). @reitermarkus, please let me know if you'd like me to open an issue first, or if I should make further changes. Thanks! Description: The goal of this change is to add information on cask installed versions when using the JSON API, as well as to make it more similar to the JSON output for formulae. For example,
Whereas if I run Justification: Adding these keys to the output makes it easier for downstream users of the API to use the Use case: I plan to use this in my https://github.com/zkokaja/Brewlet application to notify users when casks are out of date, and show them the versions they have. Open question: Should |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; if necessary, we could make changes in follow-up PRs
Thanks so much for your first contribution! Without people like you submitting PRs we couldn't run this project. You rock, @zkokaja! |
Awesome, thank you!! 😊 |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I get one failure on an unrelated test
dev-cmd/tap-new:11
becausegit
outputs a warning regarding theinit.defaultBranch
setting on new repos, and the test expected nothing in standard error.brew man
locally and committed any changes?This commit adds two new values to the
brew info --cask --json=v2
command to include whether the cask is outdated and the currently installed versions.I had to modify one test script to match the new JSON output in order to pass.