Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


`rm -f` ignores nonexistent files so you could omit the `if` to be concise.


Good 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.


You 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.


That'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).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: