diff options
| author | Adam Vandenberg | 2014-06-20 07:31:35 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2014-06-20 07:31:35 -0700 |
| commit | dc46c43e2a5e7b8ba46ef6be300af30735616308 (patch) | |
| tree | fbeee45973afa02f9f9cae1f6019e987f1bc7579 /Library | |
| parent | aa51c2f1d329b0509c47f340dd9ae7a1c30f73d5 (diff) | |
| download | brew-dc46c43e2a5e7b8ba46ef6be300af30735616308.tar.bz2 | |
Removew brew-which
This functionality is better handled by brew list --versions
and other official commands.
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/cmd/brew-which.rb | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/Library/Contributions/cmd/brew-which.rb b/Library/Contributions/cmd/brew-which.rb deleted file mode 100755 index 870ff67a5..000000000 --- a/Library/Contributions/cmd/brew-which.rb +++ /dev/null @@ -1,44 +0,0 @@ -require 'extend/pathname' - -module Homebrew - def which_versions which_brews=nil - brew_links = Array.new - version_map = Hash.new - - real_cellar = HOMEBREW_CELLAR.realpath - - (HOMEBREW_PREFIX/'opt').subdirs.each do |path| - next unless path.symlink? && path.resolved_path_exists? - brew_links << Pathname.new(path.realpath) - end - - brew_links = brew_links.collect{|p|p.relative_path_from(real_cellar).to_s}.reject{|p|p.start_with?("../")} - - brew_links.each do |p| - parts = p.split("/") - next if parts.count < 2 # Shouldn't happen for normally installed brews - brew = parts.shift - version = parts.shift - - next unless which_brews.include? brew if which_brews - - versions = version_map[brew] || [] - versions << version unless versions.include? version - version_map[brew] = versions - end - - return version_map - end - - def which - which_brews = ARGV.named.empty? ? nil : ARGV.named - - brews = which_versions which_brews - brews.keys.sort.each do |b| - puts "#{b}: #{brews[b].sort*' '}" - end - puts - end -end - -Homebrew.which |
