fetch: fix '--force' for pathnames

`brew fetch --force` was a no-op for formula pathnames when that formula
did not exist in Library/Formula, because `brew --cache #{f.name}`
results in an error for that case.

Fix it by always using f.cached_download.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2011-09-01 19:09:21 -05:00
parent 66841687eb
commit 2505ebda67

View File

@ -20,8 +20,8 @@ module Homebrew extend self
bucket.each do |f|
if ARGV.include? "--force" or ARGV.include? "-f"
where_to = `brew --cache #{f.name}`.strip
FileUtils.rm_rf where_to unless where_to.empty?
where_to = f.cached_download
FileUtils.rm_rf where_to if File.exist? where_to
end
the_tarball = f.downloader.fetch