From 046c553ed56722d3a95d73130a6e0e07719a6aaf Mon Sep 17 00:00:00 2001 From: Mikhail Klementev Date: Tue, 16 May 2023 08:17:15 +0000 Subject: [PATCH] fix: cleanup tar.gz after unpack --- cache/cache.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cache/cache.go b/cache/cache.go index 3c5d1ff..db0fb21 100644 --- a/cache/cache.go +++ b/cache/cache.go @@ -64,7 +64,11 @@ func DownloadQemuImage(path, file string) (err error) { } err = unpackTar(resp.Filename, path) - return + if err != nil { + return + } + + return os.Remove(resp.Filename) } func DownloadDebianCache(cachePath string) (err error) {