Fix casks with `depends_on` that reference pre-Mavericks
If you get an error like Error: Cask 'hex-fiend-beta' definition is invalid: invalid 'depends_on macos' value: ":lion", where hex-fiend-beta can be any cask name and :lion any macOS release name, run the following command: /usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g' This strips out all depends_on macos references from installed casks. It’s a blunt instrument – you’re editing Homebrew’s metadata files directly – but it gets things working again. ...