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

pull/3068/head
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 return nil
} }
// fallback // fallback
err := CopyFile(fs, src, dst) err := Copy(fs, src, dst)
if err != nil { if err != nil {
_ = fs.Remove(dst) _ = fs.Remove(dst)
return err return err
} }
if err := fs.Remove(src); err != nil { if err := fs.RemoveAll(src); err != nil {
return err return err
} }
return nil return nil