Skip to content

Commit

Permalink
Remove temporary directories
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
rabadin committed Aug 29, 2024
1 parent 33271b9 commit 8047a24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ func (l *Resource) Download(dir string, mode os.FileMode, ctx context.Context) e
// Download file in the target directory so that the call to
// os.Rename is atomic.
lpath, err := GetUrlToDir(u, dir, ctx)
defer func(path string) {
pathDir := filepath.Dir(path)
os.RemoveAll(pathDir)
}(lpath)
if err != nil {
break
}
Expand Down

0 comments on commit 8047a24

Please sign in to comment.