Only output machine readable data if the terminal is not interactive
This commit is contained in:
parent
65e851d646
commit
32bb18e9b9
@ -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] || ""
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user