Skip to content

Commit

Permalink
user XDG_CACHE_HOME on Linux
Browse files Browse the repository at this point in the history
This variable was getting filtered out before so it wasn't possible
for us to use it as the default for HOMEBREW_DEFAULT_CACHE
and HOMEBREW_DEFAULT_LOGS.
  • Loading branch information
apainintheneck committed Oct 29, 2023
1 parent 97eda64 commit ca287c4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Library/Homebrew/brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ then
HOMEBREW_DEFAULT_LOGS="${HOME}/Library/Logs/Homebrew"
HOMEBREW_DEFAULT_TEMP="/private/tmp"
else
CACHE_HOME="${XDG_CACHE_HOME:-${HOME}/.cache}"
CACHE_HOME="${HOMEBREW_XDG_CACHE_HOME:-${HOME}/.cache}"
HOMEBREW_DEFAULT_CACHE="${CACHE_HOME}/Homebrew"
HOMEBREW_DEFAULT_LOGS="${CACHE_HOME}/Homebrew/Logs"
HOMEBREW_DEFAULT_TEMP="/tmp"
Expand Down
7 changes: 7 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ then
export HOMEBREW_EDITOR="${VISUAL}"
fi

# set from user environment
# Needed to create the default cache and log paths on Linux.
if [[ -n "${XDG_CACHE_HOME:-}" ]]
then
export HOMEBREW_XDG_CACHE_HOME="${XDG_CACHE_HOME}"
fi

# set from user environment
# shellcheck disable=SC2154
# Set CI variable for Azure Pipelines and Jenkins
Expand Down

0 comments on commit ca287c4

Please sign in to comment.