DEV Community

Stephen Charles Weiss
Stephen Charles Weiss

Posted on • Originally published at on

Updating A Homebrew Cask

I recently started using FSNotes, an open source notes manager for MacOS and iOS.

It’s been amazing seeing the work that @glushchenko is putting into the app and fun to contribute in the little ways that I’m able.

While the app is distributed via the App Store, it’s also available via homebrew on MacOS.

Updating the cask on Homebrew, however, is not an automated process, so it’s possible that changes pushed to the App Store are not available via Homebrew.

That said, updating the cask is simple and the very first section of Homebrew’s guide on contributing:

Updating a Cask

Notice an application that’s out-of-date in Homebrew Cask? In most cases, it’s very simple to update it. We have a script that will ask for the new version number, and take care of updating the Cask file and submitting a pull request to us:

# install and setup script - only needed once
brew install vitorgalvao/tiny-scripts/cask-repair
cask-repair --help

# use to update <outdated_cask>
cask-repair <outdated_cask>

If there is a more complicated change, or there is a case where cask-repair fails (for example, where a Cask uses a url do block or the language stanza), you can also follow the steps in Adding a Cask to do the same thing manually. Remember to update the version and shasum values.

Maybe one day I’ll need to actually add a cask to the registry, but in the mean time, it’s good to know how I can help keep things up to date!

I updated my very first cask! Though it had already been updated, I ran into a checksum error when trying to upgrade it locally, so decided to try my hand at updating the cask myself. It worked!

$ brew cask upgrade
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.

==> Casks with `auto_updates` or `version :latest` will not be upgraded
==> Upgrading 1 outdated package:
fsnotes 4.0.9 -> 4.0.12
==> Upgrading fsnotes
==> Downloading
Already downloaded: /Users/stephen/Library/Caches/Homebrew/downloads/
==> Verifying SHA-256 checksum for Cask 'fsnotes'.
==> Backing App '' up to '/usr/local/Caskroom/fsnotes/4.0.9/'.
==> Removing App '/Applications/'.
unzip -o /Users/stephen/Library/Caches/Homebrew/downloads/ -d /var/folders/69/p2k36l7s555c8ss_7pk28c280000gn/T/d20191206-20876-momxap
cp -pR /var/folders/69/p2k36l7s555c8ss_7pk28c280000gn/T/d20191206-20876-momxap/ /usr/local/Caskroom/fsnotes/4.0.12/
chmod -Rf +w /var/folders/69/p2k36l7s555c8ss_7pk28c280000gn/T/d20191206-20876-momxap
==> Moving App '' to '/Applications/'.
==> Purging files for version 4.0.9 of Cask fsnotes
🍺 fsnotes was successfully upgraded!

Top comments (0)