-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Labels
Description
Reproduction:
import { cpSync } from "node:fs";
for (let i = 0; i < 2; i++) {
cpSync("folder", "other", {
force: true,
recursive: true
});
}
> mkdir other
> node main.mjs
> deno run -A main.mjs
error: Uncaught (in promise) AlreadyExists: Cannot create a file when that file already exists. (os error 183)
cpSync("folder", "other", {
^
at cpSync (ext:deno_node/_fs/_fs_cp.js:17:3)
at file:///V:/scratch/main.mjs:4:3
Reason is the op doesn't even use the options:
deno/ext/node/polyfills/_fs/_fs_cp.js
Lines 12 to 18 in 5194222
export function cpSync(src, dest, options) { | |
validateCpOptions(options); | |
const srcPath = getValidatedPath(src, "src"); | |
const destPath = getValidatedPath(dest, "dest"); | |
op_node_cp_sync(srcPath, destPath); | |
} |
johnstonphilip and chyzwar