Skip to content

Commit

Permalink
Merge pull request #17999 from ntkme/curlrc-analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid authored Aug 12, 2024
2 parents c23c367 + 2e2db25 commit f021b7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Library/Homebrew/utils/analytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,12 @@ def deferred_curl(url, args)
require "utils/curl"

curl = Utils::Curl.curl_executable
args = Utils::Curl.curl_args(*args, "--silent", "--output", "/dev/null", show_error: false)
if ENV["HOMEBREW_ANALYTICS_DEBUG"]
puts "#{curl} #{args.join(" ")} \"#{url}\""
puts Utils.popen_read(curl, *args, url)
else
pid = fork do
exec curl, *args, "--silent", "--output", "/dev/null", url
end
pid = spawn curl, *args, url
Process.detach T.must(pid)
end
end
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/utils/curl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def clear_path_cache
show_error: T.nilable(T::Boolean),
user_agent: T.any(String, Symbol, NilClass),
referer: T.nilable(String),
).returns(T::Array[T.untyped])
).returns(T::Array[String])
}
def curl_args(
*extra_args,
Expand Down Expand Up @@ -129,7 +129,7 @@ def curl_args(

args << "--referer" << referer if referer.present?

args + extra_args
(args + extra_args).map(&:to_s)
end

def curl_with_workarounds(
Expand Down

0 comments on commit f021b7f

Please sign in to comment.