Skip to content

Update Homebrew-managed apps from within Latest - #607

Open
joshmans wants to merge 1 commit into
mangerlahn:mainfrom
joshmans:pr/homebrew-in-app-update
Open

joshmans wants to merge 1 commit into
mangerlahn:mainfrom
joshmans:pr/homebrew-in-app-update

Conversation

@joshmans

Copy link
Copy Markdown

Addresses #288.

When Homebrew already manages an app's cask (its folder exists in the Caskroom), the update button now runs brew upgrade --cask --greedy <token> as a normal update operation with progress and errors. Apps that were not installed through Homebrew keep opening the app as before, so nothing is ever installed over an existing app. The cask token is validated before it reaches brew, and brew is located in the Apple silicon or Intel default prefix. The token is passed from UpdateRepository to the checker.

Source.supportState for .homebrew stays .limited, since not every Homebrew-matched app can be updated this way. That is a decision for the maintainer.

Tests cover detecting managed casks (a temporary Caskroom), token validation and the exact arguments. The operation itself has been exercised for real on my machine with several casks (brew upgrade --cask --greedy for a managed cask finishes and the app list refreshes), but there is no automated test that runs brew.

Written with Claude's help. The only failure in the suite is VersionParserTest.testEmptyVersionParsing, which already fails on main.

🤖 Generated with Claude Code

The update button for an app matched to a Homebrew cask only opened the app. When
Homebrew already manages the cask (its folder exists in the Caskroom), the button now
runs 'brew upgrade --cask --greedy <token>' as a regular update operation, with the
usual progress state and error reporting. --greedy includes casks that update
themselves, which Latest already lists.

Apps that were not installed through Homebrew, or when brew is missing, keep opening
the app as before; nothing is installed over an existing app. The cask token is
validated before it reaches brew.

Addresses mangerlahn#288. The command is not covered by an automated test that runs brew;
the tests cover detecting managed casks and validating tokens and arguments.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ThumosMalorus

Copy link
Copy Markdown

👍 Built this locally on macOS 27 and it works well for me. Homebrew apps that used to just open now update right inside Latest.

I also tested it merged with moreaki's auto-refresh branch (feature/issue-547-auto-refresh-updates, for #547). The two merged cleanly and worked fine together. My combined build is here if it helps: https://github.com/ThumosMalorus/Latest/tree/combined

Thanks for the work on this.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants