Clear cached curl path where HOMEBREW_CURL changes

This commit is contained in:
Bo Anderson 2022-05-30 04:10:25 +01:00
parent db8ab91429
commit 50437ca07e
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65
3 changed files with 6 additions and 0 deletions

View File

@ -823,6 +823,7 @@ class FormulaInstaller
if formula.name == "curl" && if formula.name == "curl" &&
!DevelopmentTools.curl_handles_most_https_certificates? !DevelopmentTools.curl_handles_most_https_certificates?
ENV["HOMEBREW_CURL"] = formula.opt_bin/"curl" ENV["HOMEBREW_CURL"] = formula.opt_bin/"curl"
Utils::Curl.clear_path_cache
end end
caveats caveats

View File

@ -203,6 +203,7 @@ RSpec.configure do |config|
FormulaInstaller.clear_attempted FormulaInstaller.clear_attempted
FormulaInstaller.clear_installed FormulaInstaller.clear_installed
FormulaInstaller.clear_fetched FormulaInstaller.clear_fetched
Utils::Curl.clear_path_cache
TEST_DIRECTORIES.each(&:mkpath) TEST_DIRECTORIES.each(&:mkpath)

View File

@ -42,6 +42,10 @@ module Utils
@curl_path ||= Utils.popen_read(curl_executable, "--homebrew=print-path").chomp.presence @curl_path ||= Utils.popen_read(curl_executable, "--homebrew=print-path").chomp.presence
end end
def clear_path_cache
@curl_path = nil
end
sig { sig {
params( params(
extra_args: T.untyped, extra_args: T.untyped,