misc: clean up immediately and avoid delayed defer

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
pull/4329/head
Hidde Beydals 1 year ago
parent ba1180ad4d
commit f137263fe9
No known key found for this signature in database
GPG Key ID: 979F380FC2341744

@ -116,13 +116,14 @@ func (b *Builder) Diff() (string, bool, error) {
if err != nil { if err != nil {
return "", createdOrDrifted, err return "", createdOrDrifted, err
} }
defer cleanupDir(tmpDir)
err = diff(liveFile, mergedFile, &output) err = diff(liveFile, mergedFile, &output)
if err != nil { if err != nil {
cleanupDir(tmpDir)
return "", createdOrDrifted, err return "", createdOrDrifted, err
} }
cleanupDir(tmpDir)
createdOrDrifted = true createdOrDrifted = true
} }

Loading…
Cancel
Save