buo / homebrew-cask-upgrade

A command line tool for upgrading every outdated app installed by Homebrew Cask
MIT License
2.39k stars 89 forks source link

Fix latest version detection on casks with livecheck block #250

Closed Mick235711 closed 2 months ago

Mick235711 commented 2 months ago

Currently, for all casks with a livecheck do block (that are not in the main Cask repository), the latest version cannot be detected, even though it is present in brew info. CleanShot 2024-04-16 at 02 30 07@2x (Note that font-sauce-code-pro-nerd-font.rb has a livecheck do block, while font-meslo-for-powerlevel10k.rb does not, even though they are both in Cask Fonts.)

Currently, the load_cask function (basically just CaskLoader.load) throws the following CaskUnavailableError error when facing such casks:

Cask 'font-sauce-code-pro-nerd-font' is unreadable: uninitialized constant Livecheck::Formula

Adding a requires clause fixes this issue.

Mick235711 commented 2 months ago

Ping @ondrejfuhrer