diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index 1172462d084fe..c4540961a098a 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -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 diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index a5fe7bab5fde3..fea66022a317d 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -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, @@ -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(