brew.sh: make analytics 'curl' fully asynchronous
If analytics are enabled and `brew` is used in a command substitution context, e.g. `brew search` for tab completion, the result is that even though the Google Analytics `curl` process runs in the background it still is attached to the captured `stdout`, thus could theoretically contribute to the result of the command substitution and consequently makes the command substitution block on the completion of this process. Redirecting `stdout` (and `stderr` for good measure) to `/dev/null` makes this process truly asynchronous in these contexts. Furthermore, even if the process is in the background, it is still included in the shell's job list and thus shell internals like `wait` (used in `cmd/update.sh`) have to wait on this process, even if they never intended to do so. Removing the analytics process from the job list via `disown` avoids this unintended effect. Fixes #29. Closes #34. Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
This commit is contained in:
parent
37b817ed39
commit
15b42301e5
@ -228,7 +228,8 @@ then
|
||||
-d av="$HOMEBREW_VERSION" \
|
||||
-d t=screenview \
|
||||
-d cd="$HOMEBREW_COMMAND" \
|
||||
&
|
||||
&> /dev/null \
|
||||
& disown
|
||||
fi
|
||||
|
||||
if [[ -n "$HOMEBREW_BASH_COMMAND" ]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user