MCPcopy Create free account
hub / github.com/NirmalScaria/firebase-nextjs / copyFiles

Function copyFiles

scripts/a_copyComponents.mjs:4–16  ·  view source on GitHub ↗
(source, target)

Source from the content-addressed store, hash-verified

2import fs from 'fs';
3
4const copyFiles = (source, target) => {
5 const files = fs.readdirSync(source);
6 files.forEach(file => {
7 const filePath = path.join(source, file);
8 const targetPath = path.join(target, file);
9 if (fs.lstatSync(filePath).isDirectory()) {
10 if (!fs.existsSync(targetPath)) fs.mkdirSync(targetPath);
11 copyFiles(filePath, targetPath);
12 } else {
13 fs.copyFileSync(filePath, targetPath);
14 }
15 });
16}
17
18export async function copyComponents() {
19 var isUsingSrc = false;

Callers 1

copyComponentsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected