diff options
| author | Jack Nagel | 2014-04-27 19:45:18 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-04-27 19:45:36 -0500 |
| commit | a31393f2cd16944ac75b0e24341990eb7df691be (patch) | |
| tree | e0a0bbf644f6a9fc621c386f115a7852b576cdd5 /Library | |
| parent | 5012a45cf37f94829ab678f32f714520aceadb62 (diff) | |
| download | brew-a31393f2cd16944ac75b0e24341990eb7df691be.tar.bz2 | |
Fix brew-readall for updated tap structure
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-readall.rb | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/Library/Contributions/cmd/brew-readall.rb b/Library/Contributions/cmd/brew-readall.rb index 5316fbbd6..3707f5a06 100755 --- a/Library/Contributions/cmd/brew-readall.rb +++ b/Library/Contributions/cmd/brew-readall.rb @@ -6,26 +6,30 @@ require 'formula' require 'cmd/tap' -formulae = [] -if ARGV.empty? - formulae = Formula.names -else - tap_name = ARGV.first - # Allow use of e.g. homebrew/versions or homebrew-versions - tap_dir = tap_name.reverse.sub('/', '-').reverse - tap = Pathname("#{HOMEBREW_LIBRARY}/Taps/#{tap_dir}") - raise "#{tap} does not exist!" unless tap.exist? - tap.find_formula do |f| - formulae << tap/f - end -end +module Homebrew + def readall + formulae = [] + if ARGV.empty? + formulae = Formula.names + else + user, repo = tap_args + user.downcase! + repo.downcase! + tap = HOMEBREW_LIBRARY/"Taps/#{user}/homebrew-#{repo}" + raise "#{tap} does not exist!" unless tap.directory? + tap.find_formula { |f| formulae << f } + end -formulae.sort.each do |n| - begin - Formula.factory(n) - rescue Exception => e - onoe "problem in #{Formula.path(n)}" - puts e - Homebrew.failed = true + formulae.sort.each do |n| + begin + Formula.factory(n) + rescue Exception => e + onoe "problem in #{Formula.path(n)}" + puts e + Homebrew.failed = true + end + end end end + +Homebrew.readall |
