MCPcopy Create free account
hub / github.com/Xchristech2/Zenitsu-Bot / copyRecursive

Function copyRecursive

commands/update.js:113–127  ·  view source on GitHub ↗
(src, dest, ignore = [], relative = '', outList = [])

Source from the content-addressed store, hash-verified

111}
112
113function copyRecursive(src, dest, ignore = [], relative = '', outList = []) {
114 if (!fs.existsSync(dest)) fs.mkdirSync(dest, { recursive: true });
115 for (const entry of fs.readdirSync(src)) {
116 if (ignore.includes(entry)) continue;
117 const s = path.join(src, entry);
118 const d = path.join(dest, entry);
119 const stat = fs.lstatSync(s);
120 if (stat.isDirectory()) {
121 copyRecursive(s, d, ignore, path.join(relative, entry), outList);
122 } else {
123 fs.copyFileSync(s, d);
124 if (outList) outList.push(path.join(relative, entry).replace(/\\/g, '/'));
125 }
126 }
127}
128
129async function updateViaZip(sock, chatId, message, zipOverride) {
130 const zipUrl = (zipOverride || settings.updateZipUrl || process.env.UPDATE_ZIP_URL || '').trim();

Callers 1

updateViaZipFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected