MCPcopy Index your code
hub / github.com/nodejs/node / onDir

Function onDir

lib/internal/fs/cp/cp.js:303–315  ·  view source on GitHub ↗
(srcStat, destStat, src, dest, opts)

Source from the content-addressed store, hash-verified

301}
302
303async function onDir(srcStat, destStat, src, dest, opts) {
304 if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts);
305 if (opts.errorOnExist && !opts.force) {
306 throw new ERR_FS_CP_EEXIST({
307 message: `${dest} already exists`,
308 path: dest,
309 syscall: 'cp',
310 errno: EEXIST,
311 code: 'EEXIST',
312 });
313 }
314 return copyDir(src, dest, opts);
315}
316
317async function mkDirAndCopy(srcMode, src, dest, opts) {
318 await mkdir(dest);

Callers 1

getStatsForCopyFunction · 0.70

Calls 2

mkDirAndCopyFunction · 0.85
copyDirFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…