MCPcopy Create free account
hub / github.com/GrapesJS/cli / copyRecursiveSync

Function copyRecursiveSync

src/utils.ts:66–78  ·  view source on GitHub ↗
(src: string, dest: string)

Source from the content-addressed store, hash-verified

64}
65
66export const copyRecursiveSync = (src: string, dest: string) => {
67 const exists = fs.existsSync(src);
68 const isDir = exists && fs.statSync(src).isDirectory();
69
70 if (isDir) {
71 fs.mkdirSync(dest);
72 fs.readdirSync(src).forEach((file) => {
73 copyRecursiveSync(path.join(src, file), path.join(dest, file));
74 });
75 } else if (exists) {
76 fs.copyFileSync(src, dest);
77 }
78};
79
80export const isPathExists = async (path: string) => {
81 try {

Callers 1

buildLocaleFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected