New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dev-cmd/unbottled: Fail nicely if HOMEBREW_NO_ANALYTICS
is set
#9312
dev-cmd/unbottled: Fail nicely if HOMEBREW_NO_ANALYTICS
is set
#9312
Conversation
Review period will end on 2020-11-27 at 16:59:22 UTC. |
Wait... maybe this was a red herring. Maybe it crashed because I didn't specify a formula (I assumed that |
Turns out it does work like I thought it does (so this fix is good), I just read too fast! |
I'd suggest instead checking for
and doing something like raise UsageError,
"default sort by analytics data requires `HOMEBREW_NO_GITHUB_API` and `HOMEBREW_NO_ANALYTICS` to be unset!" because the current conditions won't quite catch all the cases where this can occur. |
f1cd040
to
0dc8ada
Compare
The review period works for better code! Thanks @MikeMcQuaid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 to 🚢 once typo change and brew style
are fixed.
- When testing `brew unbottled <formula>` this crashed because I, as a maintainer, have `HOMEBREW_NO_ANALYTICS` set on all my machines to avoid polluting the analytics with test installs. ``` ❯ brew unbottled ==> Getting formulae... ==> Getting analytics data... Error: undefined method `[]' for nil:NilClass /usr/local/Homebrew/Library/Homebrew/dev-cmd/unbottled.rb:89:in `formulae_all_sort_installs_from_args' /usr/local/Homebrew/Library/Homebrew/dev-cmd/unbottled.rb:49:in `unbottled' /usr/local/Homebrew/Library/Homebrew/brew.rb:119:in `<main>' ```
0dc8ada
to
ca999a8
Compare
Review period ended. |
brew style
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?brew unbottled
this crashed because I, as a maintainer, haveHOMEBREW_NO_ANALYTICS
set on all my machines to avoid polluting the analytics with test installs.