Use EnvConfig methods over direct ENV access

This commit is contained in:
Bo Anderson 2022-05-30 04:15:28 +01:00
parent 8d0ef708db
commit a2033c397e
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
2 changed files with 7 additions and 7 deletions

View File

@ -54,9 +54,9 @@ module Homebrew
ENV["HOMEBREW_LINUXBREW_CORE_MIGRATION"].blank? ENV["HOMEBREW_LINUXBREW_CORE_MIGRATION"].blank?
ohai "Re-running `brew update` for linuxbrew-core migration" ohai "Re-running `brew update` for linuxbrew-core migration"
if ENV["HOMEBREW_CORE_DEFAULT_GIT_REMOTE"] != ENV["HOMEBREW_CORE_GIT_REMOTE"] if HOMEBREW_CORE_DEFAULT_GIT_REMOTE != Homebrew::EnvConfig.core_git_remote
opoo <<~EOS opoo <<~EOS
HOMEBREW_CORE_GIT_REMOTE was set: #{ENV["HOMEBREW_CORE_GIT_REMOTE"]}. HOMEBREW_CORE_GIT_REMOTE was set: #{Homebrew::EnvConfig.core_git_remote}.
It has been unset for the migration. It has been unset for the migration.
You may need to change this from a linuxbrew-core mirror to a homebrew-core one. You may need to change this from a linuxbrew-core mirror to a homebrew-core one.
@ -64,9 +64,9 @@ module Homebrew
end end
ENV.delete("HOMEBREW_CORE_GIT_REMOTE") ENV.delete("HOMEBREW_CORE_GIT_REMOTE")
if ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"] != ENV["HOMEBREW_BOTTLE_DOMAIN"] if HOMEBREW_BOTTLE_DEFAULT_DOMAIN != Homebrew::EnvConfig.bottle_domain
opoo <<~EOS opoo <<~EOS
HOMEBREW_BOTTLE_DOMAIN was set: #{ENV["HOMEBREW_BOTTLE_DOMAIN"]}. HOMEBREW_BOTTLE_DOMAIN was set: #{Homebrew::EnvConfig.bottle_domain}.
It has been unset for the migration. It has been unset for the migration.
You may need to change this from a Linuxbrew package mirror to a Homebrew one. You may need to change this from a Linuxbrew package mirror to a Homebrew one.
@ -142,7 +142,7 @@ module Homebrew
end end
Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"] Homebrew.failed = true if ENV["HOMEBREW_UPDATE_FAILED"]
return if ENV["HOMEBREW_DISABLE_LOAD_FORMULA"] return if Homebrew::EnvConfig.disable_load_formula?
hub = ReporterHub.new hub = ReporterHub.new

View File

@ -12,7 +12,7 @@ module Homebrew
module_function module_function
WATCHLIST_PATH = ( WATCHLIST_PATH = (
ENV["HOMEBREW_LIVECHECK_WATCHLIST"] || Homebrew::EnvConfig.livecheck_watchlist ||
"#{Dir.home}/.brew_livecheck_watchlist" "#{Dir.home}/.brew_livecheck_watchlist"
).freeze ).freeze
@ -58,7 +58,7 @@ module Homebrew
if args.debug? && args.verbose? if args.debug? && args.verbose?
puts args puts args
puts ENV["HOMEBREW_LIVECHECK_WATCHLIST"] if ENV["HOMEBREW_LIVECHECK_WATCHLIST"].present? puts Homebrew::EnvConfig.livecheck_watchlist if Homebrew::EnvConfig.livecheck_watchlist.present?
end end
formulae_and_casks_to_check = if args.tap formulae_and_casks_to_check = if args.tap