(dir, relativePath = "")
| 7 | const outputDirectory = path.join(process.cwd(), "public/data/events"); |
| 8 | |
| 9 | const collectMdxFiles = (dir, relativePath = "") => { |
| 10 | let results = []; |
| 11 | const list = fs.readdirSync(dir); |
| 12 | list.forEach((file) => { |
| 13 | const fullPath = path.join(dir, file); |
| 14 | const stat = fs.statSync(fullPath); |
| 15 | if (stat && stat.isDirectory()) { |
| 16 | results = results.concat( |
| 17 | collectMdxFiles(fullPath, path.join(relativePath, file)), |
| 18 | ); |
| 19 | } else if (file.endsWith(".mdx")) { |
| 20 | results.push({ fullPath, relativePath: path.join(relativePath, file) }); |
| 21 | } |
| 22 | }); |
| 23 | return results; |
| 24 | }; |
| 25 | |
| 26 | const processEventsMarkdownFiles = async () => { |
| 27 | const filePaths = collectMdxFiles(markdownDirectory); |
no outgoing calls
no test coverage detected