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.
This commit is contained in:
Charlie Sharpsteen 2011-09-19 19:05:44 -07:00
parent ea30b66ced
commit d05478e85b

View File

@ -559,6 +559,9 @@ private
downloader = @downloader downloader = @downloader
mirror_list = mirrors mirror_list = mirrors
# Ensure the cache exists
HOMEBREW_CACHE.mkpath
begin begin
fetched = downloader.fetch fetched = downloader.fetch
rescue CurlDownloadStrategyError => e rescue CurlDownloadStrategyError => e
@ -606,7 +609,6 @@ EOF
private private
def stage def stage
HOMEBREW_CACHE.mkpath
fetched, downloader = fetch fetched, downloader = fetch
verify_download_integrity fetched if fetched.kind_of? Pathname verify_download_integrity fetched if fetched.kind_of? Pathname
mktemp do mktemp do