diff options
Diffstat (limited to 'Library/Homebrew/cmd/tap.rb')
| -rw-r--r-- | Library/Homebrew/cmd/tap.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index f20266195..bdcc8369e 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -6,6 +6,8 @@ module Homebrew extend self tapd.children.each do |tap| puts tap.basename.sub('-', '/') if (tap/'.git').directory? end if tapd.directory? + elsif ARGV.first == "--repair" + repair_taps else install_tap(*tap_args) end @@ -58,6 +60,28 @@ module Homebrew extend self tapped end + def repair_taps + count = 0 + # prune dead symlinks in Formula + Dir["#{HOMEBREW_REPOSITORY}/Library/Formula/*.rb"].each do |fn| + if not File.exist? fn + File.delete fn + count += 1 + end + end + puts "Pruned #{count} dead formula" + + count = 0 + # check symlinks are all set in each tap + HOMEBREW_REPOSITORY.join("Library/Taps").children.each do |tap| + files = [] + tap.find_formula{ |file| files << tap.basename.join(file) } + count += link_tap_formula(files) + end + + puts "Tapped #{count} formula" + end + private def tap_args |
