Skip to content

feat: detect Homebrew cask installs and adjust update flow - #159

Merged
jatinkrmalik merged 3 commits into
mainfrom
feat/homebrew-update-detection
Jun 8, 2026
Merged

feat: detect Homebrew cask installs and adjust update flow#159
jatinkrmalik merged 3 commits into
mainfrom
feat/homebrew-update-detection

Conversation

@jatinkrmalik

@jatinkrmalik jatinkrmalik commented Jun 7, 2026

Copy link
Copy Markdown
Member

Summary

Detects when the running VocaMac app is managed by Homebrew Cask and routes available updates to Homebrew instead of the in-app DMG installer.

This now uses Homebrew Cask receipt metadata plus the staged VocaMac.app entry that resolves back to the running app bundle, so detection works after Homebrew installs the app into /Applications.

Changes

  • Add a HomebrewInstall model that carries the cask token and upgrade command.
  • Detect supported casks from standard Apple Silicon and Intel Caskroom roots:
    • vocamac
    • vocamac-nightly
  • Require a Homebrew INSTALL_RECEIPT.json before treating the app as Homebrew-managed.
  • Resolve the cask's staged VocaMac.app path or symlink back to the running bundle path.
  • Update the update sheet and About tab to show/copy the matching command:
    • brew upgrade --cask vocamac
    • brew upgrade --cask vocamac-nightly
  • Update Homebrew and data model documentation.

Testing

  • swift test
    • 195 tests passed
    • 1 skipped
  • git diff --check

Related

When VocaMac is installed via Homebrew, the in-app update checker now
detects this and shows 'Updates are managed by Homebrew' with the
brew upgrade command instead of offering in-app DMG download.

- Add isHomebrewInstalled check via /Caskroom/ path detection
- Add updateAvailableViaHomebrew state to UpdateState enum
- Show 'Copy Command' button for brew upgrade in update sheet
- Add tests for Homebrew detection and state transitions
- Update HOMEBREW.md and DATA_MODEL.md documentation
@jatinkrmalik
jatinkrmalik force-pushed the feat/homebrew-update-detection branch from 7322dea to ec6a87f Compare June 7, 2026 00:56
The static method is a pure string check that doesn't need main actor
isolation. Marking it nonisolated allows tests to call it synchronously.
@jatinkrmalik jatinkrmalik changed the title feat: detect Homebrew installation and adjust update flow feat: detect Homebrew cask installs and adjust update flow Jun 8, 2026
@jatinkrmalik
jatinkrmalik merged commit 465989a into main Jun 8, 2026
3 checks passed
@jatinkrmalik
jatinkrmalik deleted the feat/homebrew-update-detection branch August 22, 2026 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant