MCPcopy Create free account
hub / github.com/github/awesome-copilot / copyDirRecursive

Function copyDirRecursive

eng/materialize-plugins.mjs:12–23  ·  view source on GitHub ↗

* Recursively copy a directory.

(src, dest)

Source from the content-addressed store, hash-verified

10 * Recursively copy a directory.
11 */
12function copyDirRecursive(src, dest) {
13 fs.mkdirSync(dest, { recursive: true });
14 for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
15 const srcPath = path.join(src, entry.name);
16 const destPath = path.join(dest, entry.name);
17 if (entry.isDirectory()) {
18 copyDirRecursive(srcPath, destPath);
19 } else {
20 fs.copyFileSync(srcPath, destPath);
21 }
22 }
23}
24
25/**
26 * Resolve a plugin-relative path to the repo-root source file.

Callers 1

materializePluginsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected