core: Pass on the newly added box to the rest of the middleware stack
This commit is contained in:
parent
a92e03cf4c
commit
4fa12d896f
|
@ -57,9 +57,9 @@ module Vagrant
|
||||||
|
|
||||||
# Add the box
|
# Add the box
|
||||||
env[:ui].info I18n.t("vagrant.actions.box.add.adding", :name => env[:box_name])
|
env[:ui].info I18n.t("vagrant.actions.box.add.adding", :name => env[:box_name])
|
||||||
added_box = nil
|
box_added = nil
|
||||||
begin
|
begin
|
||||||
added_box = env[:box_collection].add(
|
box_added = env[:box_collection].add(
|
||||||
@temp_path, env[:box_name], box_formats, env[:box_force])
|
@temp_path, env[:box_name], box_formats, env[:box_force])
|
||||||
rescue Vagrant::Errors::BoxUpgradeRequired
|
rescue Vagrant::Errors::BoxUpgradeRequired
|
||||||
# Upgrade the box
|
# Upgrade the box
|
||||||
|
@ -75,7 +75,10 @@ module Vagrant
|
||||||
|
|
||||||
# Success, we added a box!
|
# Success, we added a box!
|
||||||
env[:ui].success(
|
env[:ui].success(
|
||||||
I18n.t("vagrant.actions.box.add.added", name: added_box.name, provider: added_box.provider))
|
I18n.t("vagrant.actions.box.add.added", name: box_added.name, provider: box_added.provider))
|
||||||
|
|
||||||
|
# Passes on the newly added box to the rest of the middleware chain
|
||||||
|
env[:box_added] = box_added
|
||||||
|
|
||||||
# Carry on!
|
# Carry on!
|
||||||
@app.call(env)
|
@app.call(env)
|
||||||
|
|
Loading…
Reference in New Issue