mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Revert "bin/brew: tighten check in export_homebrew_env_file
"
This commit is contained in:
parent
d5b7de5f02
commit
97db68d408
6
bin/brew
6
bin/brew
@ -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}"
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user