curl: handle more non-executable curl edge-cases.
Address some additional issues mentioned in #3624.
This commit is contained in:
parent
b66010605d
commit
924865ec7f
@ -2,10 +2,13 @@ require "pathname"
|
|||||||
require "open3"
|
require "open3"
|
||||||
|
|
||||||
def curl_executable
|
def curl_executable
|
||||||
curl = Pathname.new ENV["HOMEBREW_CURL"]
|
@curl ||= [
|
||||||
curl = which("curl") unless curl.exist?
|
ENV["HOMEBREW_CURL"],
|
||||||
return curl if curl.executable?
|
which("curl"),
|
||||||
raise "#{curl} is not executable"
|
"/usr/bin/curl",
|
||||||
|
].map { |c| Pathname(c) }.find(&:executable?)
|
||||||
|
raise "curl is not executable" unless @curl
|
||||||
|
@curl
|
||||||
end
|
end
|
||||||
|
|
||||||
def curl_args(*extra_args, show_output: false, user_agent: :default)
|
def curl_args(*extra_args, show_output: false, user_agent: :default)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user