Skip to content

Commit

Permalink
fix: typo and error handle
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Jun 21, 2022
1 parent 55d6434 commit 9633af4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/fs/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
3 changes: 3 additions & 0 deletions internal/operations/fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down

0 comments on commit 9633af4

Please sign in to comment.