mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
Only output machine readable data if the terminal is not interactive
This commit is contained in:
parent
65e851d646
commit
32bb18e9b9
2 changed files with 7 additions and 1 deletions
|
|
@ -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…
Reference in a new issue