We'd like to reduce the size of the API JSON and to do that we are
going to remove unused and/or blank elements from the cask/formula
definition. This will reduce the amount of data that has to go
over the wire and make it easier to load this data into memory.
The goal here is to handle the case where a cask might have a nil
url stanza because that cask is not available on the current version
of macOS or the given architecture. This just moves those checks
from the end of the `Cask::Installer#fetch` method to the beginning
so that we don't try and download casks that are missing urls.
This will now provide a helpful error message like so:
```
Error: This software does not run on macOS versions older than Big Sur.
```
Beyond that it no longer tries to run the url stanza with a nil value
when loading casks from the API.
- Load paths with no API when needed (e.g. for `brew edit`)
- Use no API mode for `brew log` as it's needed there
- Define sharding format for homebrew-cask and homebrew-core inside
`Tap` methods
- Create new formulae/casks in location defined by these `Tap` methods
- Fix a bug in Formulary that made sharded formulae lookup less
efficient (and possibly broke it for core and some API usage)
- Fix various other hardcoded Formula/Cask directory assumptions
Co-authored-by: Bo Anderson <mail@boanderson.me>
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.
The idea here is to make formula hash generation more consistent.
Set metadata when we load casks from the source API.
Set `@tap_git_head` manually.
Also, allow `auto_update` to receive false.
This is only done for consistency.
Stop double printing the `kext` caveat.
Handle Array elements correctly when substituting
path elements in artifacts. This affected how the
Uninstall Signal keys were evaluated (they are
represented as arrays of arrays).