Colorize ui output

This commit is contained in:
sophia 2022-09-12 13:23:52 -04:00
parent a718e228a4
commit 55e89ed372

View File

@ -17,6 +17,12 @@ module Vagrant
class Remote < Basic
attr_reader :client
COLOR_TO_STYLE = {
red: :error,
green: :success,
yellow: :warn
}
def initialize(client)
super()
@client = client
@ -35,6 +41,9 @@ module Vagrant
def safe_puts(message, **opts)
message, extra_opts = message
if !extra_opts[:color].nil?
extra_opts[:style] = COLOR_TO_STYLE[extra_opts[:color]]
end
opts = {
new_line: opts[:printer] == :puts,
style: extra_opts[:style],