fs: throw on existing dir in cpSync with errorOnExist · nodejs/node@f3019b5 · GitHub
Skip to content

Commit f3019b5

Browse files
watildeaduh95
authored andcommitted
fs: throw on existing dir in cpSync with errorOnExist
cpSync() did not honor errorOnExist when the destination directory already existed, while the asynchronous cp() does (fixed in the commit that added test-fs-cp-async-dir-exists-error-on-exist). Mirror that guard in the synchronous onDir() so both APIs behave identically. Signed-off-by: Daijiro Wachi <daijiro.wachi@gmail.com> PR-URL: #64124 Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 4c702e4 commit f3019b5

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎lib/internal/fs/cp/cp-sync.js‎

Lines changed: 9 additions & 0 deletions
Lines changed: 32 additions & 0 deletions

0 commit comments

Comments
 (0)