Rakefile in vagrant-exec-0.5.1 vs Rakefile in vagrant-exec-0.5.2
- old
+ new
@@ -12,9 +12,19 @@
t.cucumber_opts = %w[--format pretty]
end
desc 'Removes testing vagrant box.'
task(:cleanup) do
- system('bundle exec vagrant destroy -f')
- system('bundle exec vagrant box remove vagrant_exec virtualbox')
+ system('bundle exec vagrant box remove --force vagrant_exec')
+
+ # For some reason, vagrant destroy ID fails for us
+ # so let's just stick to pure VirtualBox
+
+ `VBoxManage list vms`
+ .split("\n")
+ .select { |line| line =~ /aruba_(default|vagrant)/ }
+ .map { |line| line.match(/\{([\w-]+)\}/)[1] }
+ .each { |uuid| system("VBoxManage unregistervm #{uuid} -delete") }
+
+ system('bundle exec vagrant global-status --prune')
end
end