mirror of
https://github.com/mudler/luet.git
synced 2025-06-27 07:50:18 +00:00
Don't cleanup the whole cache download dir, just the downloaded artifact
Otherwise whatever we download cannot be consumed (e.g. tree). Instead whoever is calling the client should care to cleanup the returned artifact
This commit is contained in:
parent
eee0136156
commit
0147b2cf99
@ -49,7 +49,6 @@ func (c *HttpClient) DownloadArtifact(artifact compiler.Artifact) (compiler.Arti
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer os.RemoveAll(temp)
|
||||
|
||||
file, err = ioutil.TempFile(temp, "HttpClient")
|
||||
if err != nil {
|
||||
@ -75,6 +74,8 @@ func (c *HttpClient) DownloadArtifact(artifact compiler.Artifact) (compiler.Arti
|
||||
if err != nil {
|
||||
continue
|
||||
}
|
||||
defer os.RemoveAll(filepath.Join(temp, artifactName))
|
||||
|
||||
ok = true
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user