Merge pull request #3941 from bukzor/curl-crash

fix: crash when curl is not installed
This commit is contained in:
Mike McQuaid 2018-03-21 08:38:56 +00:00 committed by GitHub
commit 42445dab9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,8 +6,8 @@ def curl_executable
ENV["HOMEBREW_CURL"],
which("curl"),
"/usr/bin/curl",
].map { |c| Pathname(c) }.find(&:executable?)
raise "curl is not executable" unless @curl
].compact.map { |c| Pathname(c) }.find(&:executable?)
raise "no executable curl was found" unless @curl
@curl
end