Skip to content

Commit

Permalink
fix: lastFile not refreshing info
Browse files Browse the repository at this point in the history
  • Loading branch information
just-hms committed Sep 21, 2024
1 parent ba302e5 commit 273a1b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/mv.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ func waitForDownload(logger logx.Logger, downloadPath string) (fs.FileInfo, erro
}

sourcePath := filepath.Join(downloadPath, lastFile.Name())
lastFile, err = os.Stat(sourcePath)
if err != nil {
return nil, err
}

waited := false
for osx.IsLocked(sourcePath) {
lastFile, err = os.Stat(sourcePath)
if err != nil {
return nil, err
}
waited = true
spinner.Spin("Downloading " + osx.Size(lastFile))
time.Sleep(100 * time.Millisecond)
Expand Down

0 comments on commit 273a1b3

Please sign in to comment.