From 375c2adc86da914f2d60d1bba1bdf874dabb0fc4 Mon Sep 17 00:00:00 2001 From: Steven Merrill Date: Mon, 7 Apr 2014 17:50:19 -0400 Subject: [PATCH] Start 0.0.5pre. Color output red and green like the shell provisioner. --- .gitignore | 2 ++ lib/vagrant-host-shell/provisioner.rb | 14 +++++++++++--- lib/vagrant-host-shell/version.rb | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9ef2197..cb30c58 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ test/tmp test/version_tmp tmp .vagrant +*.swo +*.swp diff --git a/lib/vagrant-host-shell/provisioner.rb b/lib/vagrant-host-shell/provisioner.rb index 06ecfe1..123cd4a 100644 --- a/lib/vagrant-host-shell/provisioner.rb +++ b/lib/vagrant-host-shell/provisioner.rb @@ -8,11 +8,19 @@ def provision :notify => [:stdout, :stderr], :workdir => config.cwd ) do |io_name, data| - @machine.env.ui.info "[#{io_name}] #{data}" + options = { + new_line: false, + prefix: false, + } + + color = io_name == :stdout ? :green : :red + options[:color] = color # if !config.keep_color + + @machine.env.ui.info(data, options) end - if config.abort_on_nonzero && !result.exit_code.zero? - raise VagrantPlugins::HostShell::Errors::NonZeroStatusError.new(config.inline, result.exit_code) + if config.abort_on_nonzero && !result.exit_code.zero? + raise VagrantPlugins::HostShell::Errors::NonZeroStatusError.new(config.inline, result.exit_code) end end diff --git a/lib/vagrant-host-shell/version.rb b/lib/vagrant-host-shell/version.rb index 77b8222..2cdbaec 100644 --- a/lib/vagrant-host-shell/version.rb +++ b/lib/vagrant-host-shell/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module HostShell - VERSION = '0.0.4' + VERSION = '0.0.5pre' end end