Revert "bin/brew: tighten check in export_homebrew_env_file"

This commit is contained in:
Mike McQuaid 2024-08-21 09:46:49 +01:00 committed by GitHub
parent d5b7de5f02
commit 97db68d408
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -108,14 +108,14 @@ HOMEBREW_LIBRARY="${HOMEBREW_REPOSITORY}/Library"
# Load Homebrew's variable configuration files from disk. # Load Homebrew's variable configuration files from disk.
export_homebrew_env_file() { export_homebrew_env_file() {
local env_file="${1}" local env_file
local homebrew_env_regex="^HOMEBREW_[A-Z_]+=[^=]*$"
env_file="${1}"
[[ -r "${env_file}" ]] || return 0 [[ -r "${env_file}" ]] || return 0
while read -r line while read -r line
do do
# only load HOMEBREW_* lines # only load HOMEBREW_* lines
[[ "${line}" =~ ${homebrew_env_regex} ]] || continue [[ "${line}" = "HOMEBREW_"* ]] || continue
export "${line?}" export "${line?}"
done <"${env_file}" done <"${env_file}"
} }