3 ms·
Here's a quick and dirty way to opt out for BASH and ZSH users for easy copy/pasting. BASH: cat <<EOF >> .bashrc # Opt out of Homebrew analytics export
by tristor 11y ago
Here's a quick and dirty way to opt out for BASH and ZSH users for easy copy/pasting.
BASH:
cat <<EOF >> .bashrc
# Opt out of Homebrew analytics
export HOMEBREW_NO_ANALYTICS=1
if [[ -e "$HOME/.homebrew_analytics_user_uuid" ]]; then
rm -f "$HOME/.homebrew_analytics_user_uuid"
fi
EOF
ZSH:
cat <<EOF >> .zshrc
# Opt out of Homebrew analytics
export HOMEBREW_NO_ANALYTICS=1
if [[ -e "$HOME/.homebrew_analytics_user_uuid" ]]; then
rm -f "$HOME/.homebrew_analytics_user_uuid"
fi
EOF
Cheers.
- alainv 11y ago`rm -f` ignores nonexistent files so you could omit the `if` to be concise.
- tristor 11y agoGood call. I was mainly using `-f` to suppress the prompt about deleting the file, but you're correct, it's unnecessary to have the if statement in this case.
- hk__2 11y agoYou don’t need to remove that file; the whole point of this env variable is that it stops Homebrew from sending any data. It won’t even be created if that variable is set.
- tristor 11y agoThat's only true if the variable is set before the first instance when data would have been sent, otherwise the file will exist (as it did on my system).