Skip to content

Commit 26b0c7e

Browse files
committed
feat: Added script for the .md files generation
1 parent 9c14e10 commit 26b0c7e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

scripts/copyMarkdown.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
function copyRecursive(srcDir, destDir) {
5+
if (!fs.existsSync(destDir)) fs.mkdirSync(destDir, { recursive: true });
6+
fs.readdirSync(srcDir).forEach((file) => {
7+
const srcPath = path.join(srcDir, file);
8+
const destPath = path.join(destDir, file);
9+
if (fs.statSync(srcPath).isDirectory()) {
10+
copyRecursive(srcPath, destPath);
11+
} else if (file.endsWith('.md')) {
12+
fs.copyFileSync(srcPath, destPath);
13+
}
14+
});
15+
}
16+
17+
const src = path.join(__dirname, '../sources');
18+
const dest = path.join(__dirname, '../build');
19+
copyRecursive(src, dest);
20+
21+
console.log('Markdown files copied from /sources to /build');

0 commit comments

Comments
 (0)