Updating A Homebrew Cask
Tags: homebrew
Published: 2020-01-23 19:11:33

---
title: Updating A Homebrew Cask
published: true
date: 2019-12-13 00:00:00 UTC
tags: homebrew
canonical_url: https://stephencharlesweiss.com/blog/2019-12-22/update-homebrew-cask/
---

I recently started using [FSNotes](https://github.com/glushchenko/fsnotes), an open source notes manager for MacOS and iOS.

It’s been amazing seeing the work that [@glushchenko](https://github.com/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](https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md#updating-a-cask):

> # <svg aria-hidden="true" focusable="false" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>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!

**Update:**
I [updated my very first cask](https://github.com/Homebrew/homebrew-cask/pull/73769)! Though it had already been updated, I ran into a [checksum error]([https://github.com/Homebrew/homebrew-cask/blob/master/doc/reporting\_bugs/checksum\_does\_not\_match\_error.md](https://github.com/Homebrew/homebrew-cask/blob/master/doc/reporting_bugs/checksum_does_not_match_error.md)) 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 https://github.com/glushchenko/fsnotes/releases/download/4.0.12/FSNotes_4.0.12.zip
Already downloaded: /Users/stephen/Library/Caches/Homebrew/downloads/fe7d920e35eb927ddceafbd7e0b4ed441ab08d5b39af9668f1bfe5dcc2df6d54--FSNotes_4.0.12.zip
==> Verifying SHA-256 checksum for Cask 'fsnotes'.
==> Backing App 'FSNotes.app' up to '/usr/local/Caskroom/fsnotes/4.0.9/FSNotes.app'.
==> Removing App '/Applications/FSNotes.app'.
unzip -o /Users/stephen/Library/Caches/Homebrew/downloads/fe7d920e35eb927ddceafbd7e0b4ed441ab08d5b39af9668f1bfe5dcc2df6d54--FSNotes_4.0.12.zip -d /var/folders/69/p2k36l7s555c8ss_7pk28c280000gn/T/d20191206-20876-momxap
cp -pR /var/folders/69/p2k36l7s555c8ss_7pk28c280000gn/T/d20191206-20876-momxap/FSNotes.app/. /usr/local/Caskroom/fsnotes/4.0.12/FSNotes.app
chmod -Rf +w /var/folders/69/p2k36l7s555c8ss_7pk28c280000gn/T/d20191206-20876-momxap
==> Moving App 'FSNotes.app' to '/Applications/FSNotes.app'.
==> Purging files for version 4.0.9 of Cask fsnotes
🍺 fsnotes was successfully upgraded!
```