curl: fall back to /usr/bin/curl when HOMEBREW_CURL doesn't exist

This can happen when `HOMEBREW_CURL` is set to brewed curl, but during

`brew resinstall curl`, brewed curl's symlink is temporary

unlinked.



So let's fallback to /usr/bin/curl in this case.
This commit is contained in:
Xu Cheng 2016-04-07 14:57:37 +08:00
parent f3cc0596a6
commit d5085edce0

View File

@ -311,6 +311,7 @@ end
def curl(*args)
curl = Pathname.new ENV["HOMEBREW_CURL"]
curl = Pathname.new "/usr/bin/curl" unless curl.exist?
raise "#{curl} is not executable" unless curl.exist? && curl.executable?
flags = HOMEBREW_CURL_ARGS