Skip to content

Commit

Permalink
Merge pull request #9096 from EricFromCanada/restore-brew-info
Browse files Browse the repository at this point in the history
info: restore printing of statistics with `brew info`
  • Loading branch information
EricFromCanada committed Nov 13, 2020
2 parents fa61eef + dd1830e commit 8561fbf
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Library/Homebrew/cmd/info.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,23 @@ def info
raise FormulaOrCaskUnspecifiedError if args.no_named?

exec_browser(*args.named.to_formulae_and_casks.map { |f| github_info(f) })
elsif args.no_named?
print_statistics
else
print_info(args: args)
end
end

def print_statistics
return unless HOMEBREW_CELLAR.exist?

count = Formula.racks.length
puts "#{count} #{"keg".pluralize(count)}, #{HOMEBREW_CELLAR.dup.abv}"
end

def print_analytics(args:)
if args.no_named?
if args.analytics?
Utils::Analytics.output(args: args)
elsif HOMEBREW_CELLAR.exist?
count = Formula.racks.length
puts "#{count} #{"keg".pluralize(count)}, #{HOMEBREW_CELLAR.dup.abv}"
end

Utils::Analytics.output(args: args)
return
end

Expand Down

0 comments on commit 8561fbf

Please sign in to comment.