Skip to content
Snippets Groups Projects
Commit 271023c5 authored by Martin Afanasjew's avatar Martin Afanasjew
Browse files

analytics: handle UUID generation errors

Avoid writing an empty UUID to the Git configuration file and disable
analytics temporarily to avoid sending bogus data with an invalid UUID.
parent db76a0f4
No related branches found
No related tags found
No related merge requests found
......@@ -36,6 +36,13 @@ setup-analytics() {
if [[ -z "$HOMEBREW_ANALYTICS_USER_UUID" ]]
then
HOMEBREW_ANALYTICS_USER_UUID="$(uuidgen)"
if [[ -z "$HOMEBREW_ANALYTICS_USER_UUID" ]]
then
# Avoid sending bogus analytics if no UUID could be generated.
export HOMEBREW_NO_ANALYTICS_THIS_RUN="1"
return
fi
git config --file="$git_config_file" --replace-all homebrew.analyticsuuid "$HOMEBREW_ANALYTICS_USER_UUID"
fi
......
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