From 853ec906efbdee9013c5d34ed1d9b8fee88a6b29 Mon Sep 17 00:00:00 2001 From: slhmy <31381093+slhmy@users.noreply.github.com> Date: Sat, 29 Jul 2023 00:24:42 +0800 Subject: [PATCH] fix: error while using fallback of dir move (#2349) --- fileutils/file.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fileutils/file.go b/fileutils/file.go index 0f782cf5..81aeffeb 100644 --- a/fileutils/file.go +++ b/fileutils/file.go @@ -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