Redirect output to stderr instead of using Basic UI class
This preserves the bolding for the version check rather than using the no format Basic class.
This commit is contained in:
parent
4a7bff3325
commit
b6c6102e85
|
@ -159,11 +159,11 @@ module Vagrant
|
|||
def version_check
|
||||
latest_version = Gem::Version.new(result["current_version"])
|
||||
installed_version = Gem::Version.new(VERSION)
|
||||
ui = Vagrant::UI::Prefixed.new(Vagrant::UI::Basic.new, "vagrant")
|
||||
ui = Vagrant::UI::Prefixed.new(env.ui, "vagrant")
|
||||
if latest_version > installed_version
|
||||
@logger.info("new version of Vagrant available - #{latest_version}")
|
||||
ui.error(I18n.t("vagrant.version_upgrade_available", latest_version: latest_version, installed_version: installed_version))
|
||||
env.ui.error("")
|
||||
ui.info(I18n.t("vagrant.version_upgrade_available", latest_version: latest_version, installed_version: installed_version), channel: :error)
|
||||
env.ui.info("", channel: :error)
|
||||
else
|
||||
@logger.debug("vagrant is currently up to date")
|
||||
end
|
||||
|
|
|
@ -175,7 +175,7 @@ describe Vagrant::Util::CheckpointClient do
|
|||
let(:result) { {"current_version" => new_version} }
|
||||
|
||||
it "should not display upgrade information" do
|
||||
expect(prefixed_ui).not_to receive(:error).at_least(:once)
|
||||
expect(prefixed_ui).not_to receive(:info).at_least(:once)
|
||||
subject.version_check
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue