Skip to content

Commit

Permalink
U: energy cli
Browse files Browse the repository at this point in the history
  • Loading branch information
sxmxta committed Dec 17, 2024
1 parent 0a9e207 commit 41d66f4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/internal/tools/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ func DownloadFile(url, localPath, proxy string, callback func(totalLength, proce
return err
}
fsize = resp.ContentLength
if err != nil {
return err
}
term.Section.Println("Download File Size: ", fsize)
fileExist := IsExistAndSize(localPath, fsize)
if fileExist {
term.Section.Println("File already exists")
Expand Down Expand Up @@ -131,6 +129,11 @@ func DownloadFile(url, localPath, proxy string, callback func(totalLength, proce
if err != nil {
return err
}
inf, err := os.Stat(localPath)
if err != nil {
return err
}
term.Section.Println("File Size: ", inf.Size())
}
return err
}

0 comments on commit 41d66f4

Please sign in to comment.