MCPcopy Create free account
hub / github.com/Drakkar-Software/OctoBot / main

Function main

docs/scripts/sync-root-docs.mjs:66–91  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64}
65
66async function main() {
67 console.log('Syncing root documentation files...');
68
69 await mkdir(OUTPUT_DIR, {recursive: true});
70
71 for (const file of FILES) {
72 const srcPath = join(ROOT, file.src);
73 try {
74 let content = stripFrontmatter(await readFile(srcPath, 'utf-8'));
75 content = adaptLinks(content);
76
77 const output = `${buildFrontmatter(file.frontmatter)}\n\n${content}\n`;
78 const destPath = join(OUTPUT_DIR, file.dest);
79 await writeFile(destPath, output, 'utf-8');
80 console.log(` ${file.src} → content/developers/${file.dest}`);
81 } catch (err) {
82 if (err.code === 'ENOENT') {
83 console.warn(` Warning: ${file.src} not found, skipping.`);
84 } else {
85 throw err;
86 }
87 }
88 }
89
90 console.log('Done syncing root docs.');
91}
92
93main().catch(err => {
94 console.error('Failed to sync root docs:', err);

Callers 1

sync-root-docs.mjsFile · 0.70

Calls 5

stripFrontmatterFunction · 0.90
joinFunction · 0.85
adaptLinksFunction · 0.85
buildFrontmatterFunction · 0.85
logMethod · 0.80

Tested by

no test coverage detected