Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HOMEBREW_SYSTEM_ENV configurable from /etc/homebrew/brew.env #18926

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,16 @@ export_homebrew_env_file() {

# First, load the system-wide configuration.
unset SYSTEM_ENV_TAKES_PRIORITY

if [[ -f "/etc/homebrew/brew.env" ]]
then
# Initial load of homebrew system env
export_homebrew_env_file "/etc/homebrew/brew.env"
fi

if [[ -n "${HOMEBREW_SYSTEM_ENV_TAKES_PRIORITY-}" ]]
then
SYSTEM_ENV_TAKES_PRIORITY="1"
else
export_homebrew_env_file "/etc/homebrew/brew.env"
fi

# Next, load the prefix configuration
Expand All @@ -152,7 +157,7 @@ fi

export_homebrew_env_file "${HOMEBREW_USER_CONFIG_HOME}/brew.env"

# If the system configuration takes priority, load it last.
# If the system configuration takes priority, reload it last.
if [[ -n "${SYSTEM_ENV_TAKES_PRIORITY-}" ]]
then
export_homebrew_env_file "/etc/homebrew/brew.env"
Expand Down
Loading