Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
Build install summary in a separate method and print all at once
Browse files Browse the repository at this point in the history
This prevents interleaved output, e.g. when running with Ruby warnings
turned on.
  • Loading branch information
jacknagel committed Dec 12, 2013
1 parent 8a40b00 commit 87172bd
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Library/Homebrew/formula_installer.rb
Expand Up @@ -319,16 +319,23 @@ def finish
post_install

ohai "Summary" if ARGV.verbose? or show_summary_heading
unless ENV['HOMEBREW_NO_EMOJI']
print "#{ENV['HOMEBREW_INSTALL_BADGE'] || "\xf0\x9f\x8d\xba"} " if MacOS.version >= :lion
end
print "#{f.prefix}: #{f.prefix.abv}"
print ", built in #{pretty_duration build_time}" if build_time
puts
puts summary
ensure
unlock if hold_locks?
end

def emoji
ENV['HOMEBREW_INSTALL_BADGE'] || "\xf0\x9f\x8d\xba"
end

def summary
s = ""
s << "#{emoji} " if MacOS.version >= :lion and not ENV['HOMEBREW_NO_EMOJI']
s << "#{f.prefix}: #{f.prefix.abv}"
s << ", built in #{pretty_duration build_time}" if build_time
s
end

def build_time
@build_time ||= Time.now - @start_time unless pour_bottle? or ARGV.interactive? or @start_time.nil?
end
Expand Down

0 comments on commit 87172bd

Please sign in to comment.