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

Function copyFiles

npm_modules/cli/src/utils/fileUtils.ts:230–241  ·  view source on GitHub ↗
(sourceDir: string, destDir: string, config: CopyConfig = {})

Source from the content-addressed store, hash-verified

228}
229
230export function copyFiles(sourceDir: string, destDir: string, config: CopyConfig = {}) {
231 // Precompile patterns for efficiency.
232 const blacklist = precompilePatterns(config.blacklist);
233 const whitelist = precompilePatterns(config.whitelist);
234
235 fs.cpSync(sourceDir, destDir, {
236 recursive: true,
237 filter: (src): boolean => {
238 return isPathAllowed(src, blacklist, whitelist);
239 },
240 });
241}
242
243export function removeFileOrDirAtPath(path: string): boolean {
244 if (!fs.existsSync(path)) {

Callers 1

copyBootstrapFilesFunction · 0.90

Calls 2

precompilePatternsFunction · 0.85
isPathAllowedFunction · 0.85

Tested by

no test coverage detected