(file)
| 7 | const themesDir = path.join(root, 'src/content/themes') |
| 8 | |
| 9 | async function refreshTheme(file) { |
| 10 | const filePath = path.join(themesDir, file) |
| 11 | const theme = JSON.parse(await fs.readFile(filePath, 'utf8')) |
| 12 | theme.stats = { ...theme.stats, ...await fetchRepositoryStats(theme.repository, theme.stats) } |
| 13 | await fs.writeFile(filePath, `${JSON.stringify(theme, null, 2)}\n`) |
| 14 | console.log(`Refreshed ${theme.slug}`) |
| 15 | } |
| 16 | |
| 17 | const files = (await fs.readdir(themesDir)).filter((file) => file.endsWith('.json')).sort() |
| 18 |
no test coverage detected