diff --git a/internal/build/diff.go b/internal/build/diff.go index c316df9f20..0dd0d9a442 100644 --- a/internal/build/diff.go +++ b/internal/build/diff.go @@ -116,13 +116,14 @@ func (b *Builder) Diff() (string, bool, error) { if err != nil { return "", createdOrDrifted, err } - defer cleanupDir(tmpDir) err = diff(liveFile, mergedFile, &output) if err != nil { + cleanupDir(tmpDir) return "", createdOrDrifted, err } + cleanupDir(tmpDir) createdOrDrifted = true }