Skip to content
Snippets Groups Projects
Commit 19e633f1 authored by Mike McQuaid's avatar Mike McQuaid Committed by GitHub
Browse files

Merge pull request #1203 from alyssais/analytics_depth

analytics: don't report commands run by Homebrew
parents 32e992ae e0d39cc3
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,10 @@ then
HOMEBREW_VERSION=">1.0.0 (no git repository)"
fi
# A depth of 1 means this command was directly invoked by a user.
# Higher depths mean this command was invoked by another Homebrew command.
export HOMEBREW_COMMAND_DEPTH=$((HOMEBREW_COMMAND_DEPTH + 1))
onoe() {
if [[ -t 2 ]] # check whether stderr is a tty.
then
......
......@@ -70,6 +70,9 @@ setup-analytics() {
report-analytics-screenview-command() {
[[ -n "$HOMEBREW_NO_ANALYTICS" || -n "$HOMEBREW_NO_ANALYTICS_THIS_RUN" ]] && return
# Don't report commands that are invoked as part of other commands.
[[ "$HOMEBREW_COMMAND_DEPTH" != 1 ]] && return
# Don't report non-official commands.
if ! [[ "$HOMEBREW_COMMAND" = "bundle" ||
"$HOMEBREW_COMMAND" = "services" ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment