- make the description more generic/correct
- use "internet archive" over "archive"
- move some logic to a new `GitHubReleases` class (for consistency)
- remove some obvious comments
- extract out and move some constants
- `--no-git` and `--branch` don't conflict as `--branch` is still used
for the GitHub Actions branch even with `--no-git`
- fix some README markdown linting errors
- fix some YAML/GitHub Actions configuration linting errors
This case is _really_ slow even although it's something we encourage
people to run often and build systems often do. The `brew --prefix`
case is really fast because it's just in Bash so: let's pull the
`brew --prefix <formula>` case into Bash too.
This doesn't handle any edge-cases like `--installed` and the formula
detection is pretty simple.
Also, to make this behaviour consistent, never output `Cellar` paths
from the (Ruby) `brew --prefix`; we never want people relying on the
Cellar paths anyway, only output them if the formula wasn't installed
(where, arguably, using a Cellar path is even worse) and the speedup is
worth this deviation in behaviour.
- Enable it by default if you've run a developer command or set
`HOMEBREW_DEVELOPER`.
- Clarify the documentation that there's various configuration in which
it doesn't work.
I've rolled this out of most of GitHub's developers with no ill effects
and we've enabled it in both CI and for various maintainers so it feels
appropriate to have a bigger rollout.
- Remove `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK` and make the behaviour
the default. We mostly already do this since we added the need for
the `--build-from-source` override on macOS. This allows us to
delete some more code.
- Still fail and require `--build-from-source` when reinstalling or
upgrading if failing on a formula-specific reason e.g. the CLT is
not/no longer installed, you're using a non-default prefix.
Fixes#10623
- A friend got an error message when trying to use `brew extract` and it
wasn't immediately obvious to me why. The usage banner only mentioned
the "formula" argument, which they'd provided. This improves the error
message when there aren't enough arguments so that others have a
chance of figuring out how to use this command without having to look
at the code for `extract_args`.
Before:
```
➜ brew extract --version='1.4' libftdi
Usage: brew extract [--version=] [--force] formula ...
[...]
Error: Invalid usage: this command requires a formula argument
```
After:
```
➜ brew extract --version='1.4' libftdi
Usage: brew extract [options] formula tap
[...]
Error: Invalid usage: This command requires at least 2 named arguments.
```
- I don't like the "at least 2" phrasing here but that's a dive into the
arg parsing code that I don't have time for right now. An alternative
was `named_args [:formula, :destination_tap]`, but that gave the error
message "requires formula or destination_tap" which wasn't great
either. I also tried `min: 2, max: 2` and that was the same "at least
2" message.