MCPcopy Create free account
hub / github.com/Snapchat/Valdi / copyDirSync

Function copyDirSync

npm_modules/cli/src/utils/skillsAdapters.ts:16–30  ·  view source on GitHub ↗

Recursively copy a directory. Skips __pycache__ and test files.

(src: string, dst: string)

Source from the content-addressed store, hash-verified

14
15/** Recursively copy a directory. Skips __pycache__ and test files. */
16function copyDirSync(src: string, dst: string): void {
17 fs.mkdirSync(dst, { recursive: true });
18 for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
19 if (entry.name.startsWith('test_') || entry.name.endsWith('.spec.ts') || entry.name === '__pycache__') {
20 continue;
21 }
22 const srcEntry = path.join(src, entry.name);
23 const dstEntry = path.join(dst, entry.name);
24 if (entry.isDirectory()) {
25 copyDirSync(srcEntry, dstEntry);
26 } else {
27 fs.copyFileSync(srcEntry, dstEntry);
28 }
29 }
30}
31
32/** Kept for backwards compatibility with cli-sc's index.ts (no-op). */
33export const conflictingClaudePluginKeys: string[] = [];

Callers 1

installFunction · 0.85

Calls 3

startsWithMethod · 0.80
joinMethod · 0.45
isDirectoryMethod · 0.45

Tested by

no test coverage detected