MCPcopy
hub / github.com/EveryInc/compound-engineering-plugin / copyDir

Function copyDir

src/utils/files.ts:152–165  ·  view source on GitHub ↗
(sourceDir: string, targetDir: string)

Source from the content-addressed store, hash-verified

150}
151
152export async function copyDir(sourceDir: string, targetDir: string): Promise<void> {
153 await ensureDir(targetDir)
154 const entries = await fs.readdir(sourceDir, { withFileTypes: true })
155 for (const entry of entries) {
156 const sourcePath = path.join(sourceDir, entry.name)
157 const targetPath = path.join(targetDir, entry.name)
158 if (entry.isDirectory()) {
159 await copyDir(sourcePath, targetPath)
160 } else if (entry.isFile()) {
161 await ensureDir(path.dirname(targetPath))
162 await fs.copyFile(sourcePath, targetPath)
163 }
164 }
165}
166
167/**
168 * Copy a skill directory, optionally transforming markdown content.

Callers 1

writeCodexBundleFunction · 0.90

Calls 1

ensureDirFunction · 0.85

Tested by

no test coverage detected