Merge pull request #7069 from MikeMcQuaid/analytics-tweaks
analytics: tweak behaviour.
This commit is contained in:
commit
1cccba6a1a
@ -51,6 +51,7 @@ module Homebrew
|
|||||||
puts <<~EOS
|
puts <<~EOS
|
||||||
#{Tty.bold}Read the analytics documentation (and how to opt-out) here:
|
#{Tty.bold}Read the analytics documentation (and how to opt-out) here:
|
||||||
#{Formatter.url("https://docs.brew.sh/Analytics")}#{Tty.reset}
|
#{Formatter.url("https://docs.brew.sh/Analytics")}#{Tty.reset}
|
||||||
|
No analytics have been recorded yet (or will be during this `brew` run).
|
||||||
|
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@ module Utils
|
|||||||
module Analytics
|
module Analytics
|
||||||
class << self
|
class << self
|
||||||
def report(type, metadata = {})
|
def report(type, metadata = {})
|
||||||
|
return if not_this_run?
|
||||||
return if disabled?
|
return if disabled?
|
||||||
|
|
||||||
args = []
|
args = []
|
||||||
@ -77,11 +78,15 @@ module Utils
|
|||||||
end
|
end
|
||||||
|
|
||||||
def disabled?
|
def disabled?
|
||||||
return true if ENV["HOMEBREW_NO_ANALYTICS"] || ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"]
|
return true if ENV["HOMEBREW_NO_ANALYTICS"]
|
||||||
|
|
||||||
config_true?(:analyticsdisabled)
|
config_true?(:analyticsdisabled)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def not_this_run?
|
||||||
|
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"].present?
|
||||||
|
end
|
||||||
|
|
||||||
def no_message_output?
|
def no_message_output?
|
||||||
# Used by Homebrew/install
|
# Used by Homebrew/install
|
||||||
ENV["HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT"].present?
|
ENV["HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT"].present?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user