Merge pull request #6273 from joehorsnell/gracefully_handle_missing_user_env_var

Gracefully handle missing USER env var
This commit is contained in:
Mike McQuaid 2019-07-03 09:59:26 +01:00 committed by GitHub
commit 895467ad9f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,6 +4,9 @@ then
export LC_ALL="en_US.UTF-8"
fi
# USER isn't always set so provide a fall back for `brew` and subprocesses.
export USER=${USER:-`id -un`}
# Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local
# for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY.
if [[ -d "$HOMEBREW_REPOSITORY/Cellar" ]]