Skip to content

Commit

Permalink
remove empty archive file creation and check error when creating dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
umbynos committed Jun 14, 2023
1 parent bfdd54a commit d757973
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions indexes/download/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ func DownloadTool(toolRelease *cores.ToolRelease) (*paths.Path, error) {
"tools",
toolRelease.Tool.Name,
toolRelease.Version.String())
installDir.MkdirAll()
if err := installDir.MkdirAll(); err != nil {
logrus.Error(err)
return nil, err
}
downloadsDir := globals.FwUploaderPath.Join("downloads")
archivePath := downloadsDir.Join(resource.ArchiveFileName)
archivePath.Parent().MkdirAll()
if err := archivePath.WriteFile(nil); err != nil {
if err := archivePath.Parent().MkdirAll(); err != nil {
logrus.Error(err)
return nil, err
}
d, err := downloader.Download(archivePath.String(), resource.URL)
d, err := downloader.Download(archivePath.String(), resource.URL, downloader.NoResume)
if err != nil {
logrus.Error(err)
return nil, err
Expand Down

0 comments on commit d757973

Please sign in to comment.