Skip to content

Commit d757973

Browse files
committed
remove empty archive file creation and check error when creating dirs
1 parent bfdd54a commit d757973

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Diff for: indexes/download/download.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,17 @@ func DownloadTool(toolRelease *cores.ToolRelease) (*paths.Path, error) {
4949
"tools",
5050
toolRelease.Tool.Name,
5151
toolRelease.Version.String())
52-
installDir.MkdirAll()
52+
if err := installDir.MkdirAll(); err != nil {
53+
logrus.Error(err)
54+
return nil, err
55+
}
5356
downloadsDir := globals.FwUploaderPath.Join("downloads")
5457
archivePath := downloadsDir.Join(resource.ArchiveFileName)
55-
archivePath.Parent().MkdirAll()
56-
if err := archivePath.WriteFile(nil); err != nil {
58+
if err := archivePath.Parent().MkdirAll(); err != nil {
5759
logrus.Error(err)
5860
return nil, err
5961
}
60-
d, err := downloader.Download(archivePath.String(), resource.URL)
62+
d, err := downloader.Download(archivePath.String(), resource.URL, downloader.NoResume)
6163
if err != nil {
6264
logrus.Error(err)
6365
return nil, err

0 commit comments

Comments
 (0)