From 2a3169da7652cca0c18f4399f5dd507333a94967 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera Date: Fri, 13 Dec 2024 06:19:16 +0800 Subject: [PATCH] bin/brew: fix prioritisation of system env files Fixes #18925. --- bin/brew | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/brew b/bin/brew index 58bc4f24a35e3..14c135f0f0c23 100755 --- a/bin/brew +++ b/bin/brew @@ -131,12 +131,12 @@ export_homebrew_env_file() { } # First, load the system-wide configuration. +export_homebrew_env_file "/etc/homebrew/brew.env" + unset SYSTEM_ENV_TAKES_PRIORITY 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 @@ -152,7 +152,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, load it again to override any previous settings. if [[ -n "${SYSTEM_ENV_TAKES_PRIORITY-}" ]] then export_homebrew_env_file "/etc/homebrew/brew.env"