Notes for Updating a Cask

Check if PR for the cask is created

Using Github website

Check from Github website. Replace %s with the cask name.

open 'https://github.com/Homebrew/homebrew-cask/search?type=Issues&q=%s'

For example to check if there is a PR for the latest polar-bookshelf:

open 'https://github.com/Homebrew/homebrew-cask/search?type=Issues&q=polar-bookshelf'

Another example to check if there is a PR for the latest origin:

open 'https://github.com/Homebrew/homebrew-cask/search?type=Issues&q=origin'

Using hub

Check from CLI with hub. Replace <cask> with the cask name.

git clone --depth=1 https://github.com/Homebrew/homebrew-cask.git /tmp/homebrew-cask && \
cd /tmp/homebrew-cask && \
hub pr list | grep <cask>

For example to check if there is a PR for the latest polar-bookshelf:

git clone --depth=1 https://github.com/Homebrew/homebrew-cask.git /tmp/homebrew-cask && \
cd /tmp/homebrew-cask && \
hub pr list | grep polar-bookshelf

Update a cask

cd $(brew --repository) && \
hub issue && \
noti cask-repair <outdated_cask> -v <version>

Ensure that we won’t have to redo (including redownloading the cask) just because we don’t have access.

Notify us when it’s done.

Skip version prompt.

Example to update polar-bookshelf

git clone https://github.com/Homebrew/homebrew-cask.git /tmp/homebrew-cask && \
cd /tmp/homebrew-cask && \
hub pr list | grep polar-bookshelf && \
noti cask-repair polar-bookshelf -v 1.0.11

Example to update origin

git clone https://github.com/Homebrew/homebrew-cask.git /tmp/homebrew-cask && \
cd /tmp/homebrew-cask && \
hub pr list | grep origin && \
noti cask-repair origin

Input password for PGP key (optional)

We do this upfront so that we won’t have to redo (including redownloading the task) just becasue we put in the wrong PGP key password.

mkdir -p /tmp/cask-repair && \
cd /tmp/cask-repair && \
git init && \
git commit --allow-empty --message 'Initialize empty Git repository' && \
cd - && \
rm -fr /tmp/cask-repair