diff --git a/internal/fs/write.go b/internal/fs/write.go index 0f3cd4f1..184a801f 100644 --- a/internal/fs/write.go +++ b/internal/fs/write.go @@ -20,7 +20,7 @@ func Move(ctx context.Context, account driver.Driver, srcPath, dstPath string) e if err != nil { return errors.WithMessage(err, "failed get src account") } - dstAccount, dstActualPath, err := operations.GetAccountAndActualPath(srcPath) + dstAccount, dstActualPath, err := operations.GetAccountAndActualPath(dstPath) if err != nil { return errors.WithMessage(err, "failed get dst account") } diff --git a/internal/operations/fs.go b/internal/operations/fs.go index 21865616..89a4ded0 100644 --- a/internal/operations/fs.go +++ b/internal/operations/fs.go @@ -151,6 +151,9 @@ func Move(ctx context.Context, account driver.Driver, srcPath, dstPath string) e return errors.WithMessage(err, "failed to get src object") } dstDir, err := Get(ctx, account, stdpath.Dir(dstPath)) + if err != nil { + return errors.WithMessage(err, "failed to get dst dir") + } return account.Move(ctx, srcObj, dstDir) }