From 5bf4efe07160eb5b10b5982c71f5778e5da2de4f Mon Sep 17 00:00:00 2001 From: Michael Linderman Date: Fri, 8 Jul 2011 14:18:02 -0700 Subject: [PATCH] Don't delete package file if package output exists --- lib/vagrant/action/general/package.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/vagrant/action/general/package.rb b/lib/vagrant/action/general/package.rb index a53cecda7..4726842bf 100644 --- a/lib/vagrant/action/general/package.rb +++ b/lib/vagrant/action/general/package.rb @@ -38,8 +38,10 @@ module Vagrant end def recover(env) - # Cleanup any packaged files if the packaging failed at some point. - File.delete(tar_path) if File.exist?(tar_path) + unless env["vagrant.error"].is_a?(Errors::PackageOutputExists) + # Cleanup any packaged files if the packaging failed at some point. + File.delete(tar_path) if File.exist?(tar_path) + end end def files_to_copy