We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c14e10 commit 26b0c7eCopy full SHA for 26b0c7e
scripts/copyMarkdown.js
@@ -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