Honor homebrew curlrc config for analytics
This commit is contained in:
parent
87440322e2
commit
5442a7e34f
@ -54,12 +54,13 @@ module Utils
|
|||||||
require "utils/curl"
|
require "utils/curl"
|
||||||
|
|
||||||
curl = Utils::Curl.curl_executable
|
curl = Utils::Curl.curl_executable
|
||||||
|
args = Utils::Curl.curl_args(*args, "--silent", "--output", "/dev/null", show_error: false)
|
||||||
if ENV["HOMEBREW_ANALYTICS_DEBUG"]
|
if ENV["HOMEBREW_ANALYTICS_DEBUG"]
|
||||||
puts "#{curl} #{args.join(" ")} \"#{url}\""
|
puts "#{curl} #{args.join(" ")} \"#{url}\""
|
||||||
puts Utils.popen_read(curl, *args, url)
|
puts Utils.popen_read(curl, *args, url)
|
||||||
else
|
else
|
||||||
pid = fork do
|
pid = fork do
|
||||||
exec curl, *args, "--silent", "--output", "/dev/null", url
|
exec curl, *args, url
|
||||||
end
|
end
|
||||||
Process.detach T.must(pid)
|
Process.detach T.must(pid)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -65,7 +65,7 @@ module Utils
|
|||||||
show_error: T.nilable(T::Boolean),
|
show_error: T.nilable(T::Boolean),
|
||||||
user_agent: T.any(String, Symbol, NilClass),
|
user_agent: T.any(String, Symbol, NilClass),
|
||||||
referer: T.nilable(String),
|
referer: T.nilable(String),
|
||||||
).returns(T::Array[T.untyped])
|
).returns(T::Array[String])
|
||||||
}
|
}
|
||||||
def curl_args(
|
def curl_args(
|
||||||
*extra_args,
|
*extra_args,
|
||||||
@ -129,7 +129,7 @@ module Utils
|
|||||||
|
|
||||||
args << "--referer" << referer if referer.present?
|
args << "--referer" << referer if referer.present?
|
||||||
|
|
||||||
args + extra_args
|
(args + extra_args).map(&:to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def curl_with_workarounds(
|
def curl_with_workarounds(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user