2010-08-25 06:05:40 +00:00
|
|
|
module Vagrant
|
|
|
|
module Command
|
2010-08-25 06:50:20 +00:00
|
|
|
class DestroyCommand < NamedBase
|
2010-09-21 18:59:05 +00:00
|
|
|
register "destroy", "Destroy the environment, deleting the created virtual machines"
|
2010-08-25 06:05:40 +00:00
|
|
|
|
|
|
|
def execute
|
|
|
|
target_vms.each do |vm|
|
|
|
|
if vm.created?
|
|
|
|
vm.destroy
|
|
|
|
else
|
2010-09-22 00:10:46 +00:00
|
|
|
vm.env.ui.info I18n.t("vagrant.commands.common.vm_not_created")
|
2010-08-25 06:05:40 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|