diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index afef17bde7..d47ffa3e23 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -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 + %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?) && diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 0831d2e3cf..1379829b6c 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -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?