aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
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