Update color for run_remote to match shell provisioner colors

This commit is contained in:
Brian Cain 2018-03-30 12:48:16 -07:00
parent 8b71c24f90
commit a857056136
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 5 additions and 2 deletions

View File

@ -169,12 +169,15 @@ module Vagrant
begin
# TODO: should we check config or command for sudo? And if so, WARN the user?
result = Vagrant::Util::Subprocess.execute(*cmd, :notify => [:stdout, :stderr]) do |type,data|
options = {}
case type
when :stdout
@machine.ui.detail(data)
options[:color] = :green if !config.keep_color
when :stderr
@machine.ui.error(data)
options[:color] = :red if !config.keep_color
end
@machine.ui.detail(data, options)
end
rescue Exception => e
# TODO: I18n me and write better message