Skip to content
Snippets Groups Projects
Commit 2d849612 authored by Jack Nagel's avatar Jack Nagel
Browse files

Formula#fetch: always return the cached path

This allows us to remove some type checks that were protecting against
potential nils.
parent daef74aa
No related branches found
No related tags found
No related merge requests found
......@@ -27,8 +27,7 @@ module Homebrew extend self
f.cached_download.rmtree if already_fetched?(f) && ARGV.force?
download = f.fetch
# FIXME why are strategies returning different types?
return unless download.is_a? Pathname
return unless download.file?
puts "Downloaded to: #{download}" unless already_fetched?(f)
puts Checksum::TYPES.map { |t| "#{t.to_s.upcase}: #{download.send(t)}" }
......
......@@ -619,6 +619,7 @@ class Formula
# Ensure the cache exists
HOMEBREW_CACHE.mkpath
downloader.fetch
cached_download
end
# For FormulaInstaller.
......@@ -644,7 +645,7 @@ class Formula
def stage
fetched = fetch
verify_download_integrity(fetched) if fetched.kind_of? Pathname
verify_download_integrity(fetched) if fetched.file?
mktemp do
downloader.stage
# Set path after the downloader changes the working folder.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment