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.
This commit is contained in:
parent
db76a0f4cc
commit
271023c5e1
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user