Merge pull request #15935 from MikeMcQuaid/api_curl_args

api: use `Utils::Curl.curl_args`
This commit is contained in:
Mike McQuaid 2023-09-03 09:31:49 -04:00 committed by GitHub
commit fc72dfc6ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View File

@ -48,15 +48,11 @@ module Homebrew
odie "Need to download #{url} but cannot as root! Run `brew update` without `sudo` first then try again."
end
# TODO: consider using more of Utils::Curl
curl_args = %W[
curl_args = Utils::Curl.curl_args(retries: 0) + %W[
--compressed
--speed-limit #{ENV.fetch("HOMEBREW_CURL_SPEED_LIMIT")}
--speed-time #{ENV.fetch("HOMEBREW_CURL_SPEED_TIME")}
]
curl_args << "--progress-bar" unless Context.current.verbose?
curl_args << "--verbose" if Homebrew::EnvConfig.curl_verbose?
curl_args << "--silent" if !$stdout.tty? || Context.current.quiet?
insecure_download = (ENV["HOMEBREW_SYSTEM_CA_CERTIFICATES_TOO_OLD"].present? ||
ENV["HOMEBREW_FORCE_BREWED_CA_CERTIFICATES"].present?) &&

View File

@ -106,7 +106,7 @@ module Utils
args << "--fail"
args << "--progress-bar" unless Context.current.verbose?
args << "--verbose" if Homebrew::EnvConfig.curl_verbose?
args << "--silent" unless $stdout.tty?
args << "--silent" if !$stdout.tty? || Context.current.quiet?
end
args << "--connect-timeout" << connect_timeout.round(3) if connect_timeout.present?