From 857beb616798bea60600d5c8f4ffadd3c2d1aabd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 2 Jul 2013 08:46:00 -0700 Subject: [PATCH] post-processor/vagrant: check for error when tarring earlier --- post-processor/vagrant/util.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/post-processor/vagrant/util.go b/post-processor/vagrant/util.go index efec96fb8..cd1c8c351 100644 --- a/post-processor/vagrant/util.go +++ b/post-processor/vagrant/util.go @@ -40,6 +40,11 @@ func DirToBox(dst, dir string) error { // This is the walk func that tars each of the files in the dir tarWalk := func(path string, info os.FileInfo, prevErr error) error { + // If there was a prior error, return it + if prevErr != nil { + return prevErr + } + // Skip directories if info.IsDir() { log.Printf("Skiping directory '%s' for box '%s'", path, dst)