aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2016-04-07 14:57:37 +0800
committerXu Cheng2016-04-07 14:57:37 +0800
commitd5085edce0b5482771c66cfe3e2c013ee3ca90f6 (patch)
treed79778d16115c192c30e4e9730fa049fab4d6c9d
parentf3cc0596a663e724c6a3b053eb5fae69e245a8a6 (diff)
downloadbrew-d5085edce0b5482771c66cfe3e2c013ee3ca90f6.tar.bz2
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.
-rw-r--r--Library/Homebrew/utils.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 4b1f6e944..86bc270c8 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -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