From 82d8285df62c3aff09791df3a61816caebbfdc31 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 13 Mar 2013 21:24:03 -0700 Subject: [PATCH] Give a success message after adding a box --- lib/vagrant/action/builtin/box_add.rb | 7 ++++++- templates/locales/en.yml | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/vagrant/action/builtin/box_add.rb b/lib/vagrant/action/builtin/box_add.rb index 7da36c9b1..3192c389b 100644 --- a/lib/vagrant/action/builtin/box_add.rb +++ b/lib/vagrant/action/builtin/box_add.rb @@ -30,8 +30,9 @@ module Vagrant # Add the box env[:ui].info I18n.t("vagrant.actions.box.add.adding", :name => env[:box_name]) + added_box = nil begin - env[:box_collection].add( + added_box = env[:box_collection].add( @temp_path, env[:box_name], env[:box_provider], env[:box_force]) rescue Vagrant::Errors::BoxUpgradeRequired # Upgrade the box @@ -45,6 +46,10 @@ module Vagrant # downloaded temporary file. recover(env) + # Success, we added a box! + env[:ui].success( + I18n.t("vagrant.actions.box.add.added", name: added_box.name, provider: added_box.provider)) + # Carry on! @app.call(env) end diff --git a/templates/locales/en.yml b/templates/locales/en.yml index 86901f28e..a4ce8eab2 100644 --- a/templates/locales/en.yml +++ b/templates/locales/en.yml @@ -792,6 +792,8 @@ en: add: adding: |- Extracting box... + added: |- + Successfully added box '%{name}' with provider '%{provider}'! destroy: destroying: "Deleting box '%{name}'..." download: