()
| 64 | } |
| 65 | |
| 66 | async 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 | |
| 93 | main().catch(err => { |
| 94 | console.error('Failed to sync root docs:', err); |
no test coverage detected