fix: copy folder between two storage (fix #1670)

This commit is contained in:
Noah Hsu
2022-09-15 17:58:32 +08:00
parent 86a625cb40
commit d9f0603271
7 changed files with 85 additions and 78 deletions

View File

@ -175,9 +175,9 @@ func (d *Local) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
dstPath := filepath.Join(dstDir.GetPath(), srcObj.GetName())
var err error
if srcObj.IsDir() {
err = copyDir(srcPath, dstPath)
err = utils.CopyDir(srcPath, dstPath)
} else {
err = copyFile(srcPath, dstPath)
err = utils.CopyFile(srcPath, dstPath)
}
if err != nil {
return err