From d05478e85b776bf262e6bf2ca7b4b883a25de5ed Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Mon, 19 Sep 2011 19:05:44 -0700 Subject: [PATCH] formula.rb: Move cache dir creation to fetch So that the cache directory will get created if the user runs `brew fetch` instead of `brew install` as the first command. --- Library/Homebrew/formula.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index f8d86844f5..6143a4689b 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -559,6 +559,9 @@ private downloader = @downloader mirror_list = mirrors + # Ensure the cache exists + HOMEBREW_CACHE.mkpath + begin fetched = downloader.fetch rescue CurlDownloadStrategyError => e @@ -606,7 +609,6 @@ EOF private def stage - HOMEBREW_CACHE.mkpath fetched, downloader = fetch verify_download_integrity fetched if fetched.kind_of? Pathname mktemp do