info: fix on non-tty terminals.
References Homebrew/homebrew#18922. Closes Homebrew/homebrew#24188. Closes Homebrew/homebrew#24190.
This commit is contained in:
parent
9dd2f1a2c3
commit
39d3cfd6ae
@ -138,15 +138,23 @@ module Homebrew extend self
|
|||||||
|
|
||||||
def decorate_dependencies dependencies
|
def decorate_dependencies dependencies
|
||||||
# necessary for 1.8.7 unicode handling since many installs are on 1.8.7
|
# necessary for 1.8.7 unicode handling since many installs are on 1.8.7
|
||||||
tick = Tty.green + ["2714".hex].pack("U*") + Tty.reset
|
tick = ["2714".hex].pack("U*")
|
||||||
cross = Tty.red + ["2718".hex].pack("U*") + Tty.reset
|
cross = ["2718".hex].pack("U*")
|
||||||
|
|
||||||
deps_status = dependencies.collect do |dep|
|
deps_status = dependencies.collect do |dep|
|
||||||
if ENV['HOMEBREW_NO_EMOJI']
|
if dep.installed?
|
||||||
"%s%s%s" % [(dep.installed? ? Tty.green : Tty.red), dep, Tty.reset]
|
color = Tty.green
|
||||||
|
symbol = tick
|
||||||
else
|
else
|
||||||
"%s %s" % [dep, (dep.installed? ? tick : cross)]
|
color = Tty.red
|
||||||
|
symbol = cross
|
||||||
end
|
end
|
||||||
|
if ENV['HOMEBREW_NO_EMOJI']
|
||||||
|
colored_dep = "#{color}#{dep}"
|
||||||
|
else
|
||||||
|
colored_dep = "#{dep} #{color}#{symbol}"
|
||||||
|
end
|
||||||
|
"#{colored_dep}#{Tty.reset}"
|
||||||
end
|
end
|
||||||
deps_status * ", "
|
deps_status * ", "
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user