Skip to content

Commit

Permalink
Implement rename dest
Browse files Browse the repository at this point in the history
Fix #109
  • Loading branch information
otiai10 committed Jan 20, 2024
1 parent 6ce0a5a commit 08dc93b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ func switchboard(src, dest string, info os.FileInfo, opt Options) (err error) {
return onError(src, dest, err, opt)
}

if opt.RenameDestination != nil {
if dest, err = opt.RenameDestination(src, dest); err != nil {
return onError(src, dest, err, opt)
}
}

switch {
case info.Mode()&os.ModeSymlink != 0:
err = onsymlink(src, dest, opt)
Expand Down

0 comments on commit 08dc93b

Please sign in to comment.