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
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