aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2010-06-15 21:52:11 -0700
committerAdam Vandenberg2010-06-15 21:52:11 -0700
commit0ed59cda67c5667eef67952f39d45b3e3db02b49 (patch)
tree4d197d9d0c6cf66cd1e220040f7e7079529f2cd0 /Library
parent8f0261a964c26925a970b1bcbb2aad0dfee0526d (diff)
downloadhomebrew-0ed59cda67c5667eef67952f39d45b3e3db02b49.tar.bz2
brew fetch --force to force redownload of tarballs
External command "brew fetch" now allows -f|--force to remove an existing cached file before downloading.
Diffstat (limited to 'Library')
-rwxr-xr-xLibrary/Contributions/examples/brew-fetch.rb6
1 files changed, 6 insertions, 0 deletions
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