diff options
| author | Mike McQuaid | 2013-11-11 22:15:24 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2013-11-11 22:15:24 +0000 |
| commit | 39d3cfd6aeee730b14935fbbc6c1a1824bcbae22 (patch) | |
| tree | b0194b268fe4e0f3223c6ba1fc7a0272f4c79b38 /Library/Homebrew/cmd/info.rb | |
| parent | 9dd2f1a2c38e583deb3938d59f36fadd5a319f2c (diff) | |
| download | brew-39d3cfd6aeee730b14935fbbc6c1a1824bcbae22.tar.bz2 | |
info: fix on non-tty terminals.
References Homebrew/homebrew#18922.
Closes Homebrew/homebrew#24188.
Closes Homebrew/homebrew#24190.
Diffstat (limited to 'Library/Homebrew/cmd/info.rb')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index 7818f788d..508efd6ff 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -138,15 +138,23 @@ module Homebrew extend self def decorate_dependencies dependencies # necessary for 1.8.7 unicode handling since many installs are on 1.8.7 - tick = Tty.green + ["2714".hex].pack("U*") + Tty.reset - cross = Tty.red + ["2718".hex].pack("U*") + Tty.reset + tick = ["2714".hex].pack("U*") + cross = ["2718".hex].pack("U*") deps_status = dependencies.collect do |dep| + if dep.installed? + color = Tty.green + symbol = tick + else + color = Tty.red + symbol = cross + end if ENV['HOMEBREW_NO_EMOJI'] - "%s%s%s" % [(dep.installed? ? Tty.green : Tty.red), dep, Tty.reset] + colored_dep = "#{color}#{dep}" else - "%s %s" % [dep, (dep.installed? ? tick : cross)] + colored_dep = "#{dep} #{color}#{symbol}" end + "#{colored_dep}#{Tty.reset}" end deps_status * ", " end |
