Only output machine readable data if the terminal is not interactive

This commit is contained in:
sophia 2022-05-31 10:53:07 -05:00
parent 65e851d646
commit 32bb18e9b9
2 changed files with 7 additions and 1 deletions

View File

@ -20,6 +20,7 @@ module Vagrant
def initialize(client)
super()
@client = client
@logger = Log4r::Logger.new("vagrant::ui")
end
def clear_line
@ -43,6 +44,11 @@ module Vagrant
end
def machine(type, *data)
if client.is_interactive
@logger.info("Machine: #{type} #{data.inspect}")
return
end
opts = {}
opts = data.pop if data.last.kind_of?(Hash)
target = opts[:target] || ""

View File

@ -19,7 +19,7 @@ module VagrantPlugins
end
def is_interactive
client.is_interactive.interactive
client.is_interactive(Empty.new).interactive
end
def input(prompt, **opts)