- This 404 error is from GitHub, and GitHub doesn't give us any more
informations about scopes for the gist endpoint (for some reason). But we can
safely assume, as it happens a lot, that "Error: Not Found" (404) is because
the user hasn't granted their `HOMEBREW_GITHUB_API_TOKEN` the `gist` scope.
Before:
```shell
$ HOMEBREW_GITHUB_API_TOKEN=<token_without_gist_scope> brew gist-logs -p logrotate
Error: Not Found
```
After:
```shell
❯ HOMEBREW_GITHUB_API_TOKEN=<token_without_gist_scope> brew gist-logs logrotate
Error: Your GitHub API token likely doesn't have the `gist` scope.
Create a GitHub personal access token:
https://github.com/settings/tokens/new?scopes=gist&description=Homebrew
echo 'export HOMEBREW_GITHUB_API_TOKEN=your_token_here' >> ~/.zshrc
```
- A user reported the following error when running `brew gist-logs`,
reproducible with any formula:
```
$ brew gist-logs rustup-init
Error: undefined method `length' for nil:NilClass
Please report this bug:
https://docs.brew.sh/Troubleshooting
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/cmd/gist-logs.rb:145:in `gist_logs'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:102:in
```
- From what I can tell, `gist_logs_args.parse` had ended up in the wrong
method. The `gistify_logs` method already has `formula` (ie the
formula name) passed into it. But it's the `gist_logs` method that needs
to do the argument parsing. This was discovered by looking at some other
recently changed ARGV => Homebrew.args code like cmd/info.
- Make `gist-logs` perform more checks
- Don't complain about a non-/usr/local install at install time unless
actually building from source.
- Show more checks output on a build error
- Improve naming of checks methods
While working on f10691bcc, I noticed this odd comment and decided to
investigate. I wasn't able to reproduce the undesirable behavior because
I cannot get 1.8.7 to compile with rvm but I did notice through some
testing that iTerm2 displays a lock character when echo mode is
disabled. My intent had been to remove this method because Homebrew has
moved past a Ruby version that would necessitate the "hack" but this
method's behavior is actually desirable today, so I changed the comment
to remove the potential flag and instead left a comment explaining
a good second reason for the method.