diff options
| author | Mike McQuaid | 2016-11-26 12:56:02 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2016-11-26 12:56:02 +0000 |
| commit | 7cd5ddfa65ba85616f2b98cb21d925c641ed0493 (patch) | |
| tree | 725f27c65921b0961bbea6d4d6b23f85baa02070 /Library/Homebrew/cmd | |
| parent | 1f3351f0cadf120a86c6fdb6d397fe089c00b21b (diff) | |
| download | brew-7cd5ddfa65ba85616f2b98cb21d925c641ed0493.tar.bz2 | |
update-report: further improve analytics messaging
- Don't output the analytics message and mark it as read if
`HOMEBREW_NO_ANALYTICS_THIS_RUN` is set. This mostly simplifies the
installer code where we can display the message ourselves there rather
than having `brew update` print it out sometimes and not others (i.e.
when there's no system Git installed).
- Use the shell's audible bell to nudge people to actually read this
message (and give them less excuse to complain when they don't).
- Add an extra newline and bold all the analytics messaging so it's
more visible in the output.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/update-report.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index 9d096c4cb..355af5da7 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -25,11 +25,19 @@ module Homebrew Utils.popen_read("git", "config", "--local", "--get", "homebrew.analyticsmessage").chuzzle analytics_disabled = \ Utils.popen_read("git", "config", "--local", "--get", "homebrew.analyticsdisabled").chuzzle - if analytics_message_displayed != "true" && analytics_disabled != "true" && !ENV["HOMEBREW_NO_ANALYTICS"] + if analytics_message_displayed != "true" && analytics_disabled != "true" && + !ENV["HOMEBREW_NO_ANALYTICS"] && !ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" - ohai "Homebrew has enabled anonymous aggregate user behaviour analytics" - puts "Read the analytics documentation (and how to opt-out) here:" - puts " https://git.io/brew-analytics" + # Use the shell's audible bell. + print "\a" + + # Use an extra newline and bold to avoid this being missed. + ohai <<-EOS.undent + Homebrew has enabled anonymous aggregate user behaviour analytics + Read the analytics documentation (and how to opt-out) here: + https://git.io/brew-analytics + + EOS # Consider the message possibly missed if not a TTY. if $stdout.tty? |
