fix: error while using fallback of dir move (#2349)

This commit is contained in:
slhmy 2023-07-29 00:24:42 +08:00 committed by GitHub
parent 7b35815754
commit 853ec906ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -17,12 +17,12 @@ func MoveFile(fs afero.Fs, src, dst string) error {
return nil
}
// fallback
err := CopyFile(fs, src, dst)
err := Copy(fs, src, dst)
if err != nil {
_ = fs.Remove(dst)
return err
}
if err := fs.Remove(src); err != nil {
if err := fs.RemoveAll(src); err != nil {
return err
}
return nil