MCPcopy Create free account
hub / github.com/garrytan/gstack / copyDirSync

Function copyDirSync

test/skill-e2e.test.ts:96–107  ·  view source on GitHub ↗

* Copy a directory tree recursively (files only, follows structure).

(src: string, dest: string)

Source from the content-addressed store, hash-verified

94 * Copy a directory tree recursively (files only, follows structure).
95 */
96function copyDirSync(src: string, dest: string) {
97 fs.mkdirSync(dest, { recursive: true });
98 for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
99 const srcPath = path.join(src, entry.name);
100 const destPath = path.join(dest, entry.name);
101 if (entry.isDirectory()) {
102 copyDirSync(srcPath, destPath);
103 } else {
104 fs.copyFileSync(srcPath, destPath);
105 }
106 }
107}
108
109/**
110 * Set up browse shims (binary symlink, find-browse, remote-slug) in a tmpDir.

Callers 1

skill-e2e.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected