From 0ed59cda67c5667eef67952f39d45b3e3db02b49 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Tue, 15 Jun 2010 21:52:11 -0700 Subject: brew fetch --force to force redownload of tarballs External command "brew fetch" now allows -f|--force to remove an existing cached file before downloading. --- Library/Contributions/examples/brew-fetch.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Library') diff --git a/Library/Contributions/examples/brew-fetch.rb b/Library/Contributions/examples/brew-fetch.rb index 73e1f6a87..a3fb29320 100755 --- a/Library/Contributions/examples/brew-fetch.rb +++ b/Library/Contributions/examples/brew-fetch.rb @@ -1,7 +1,13 @@ # Downloads the tarballs for the given formulae to the Cache require 'formula' +require 'fileutils' ARGV.formulae.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? + end + f.downloader.fetch end -- cgit v1.2.3