1
0
mirror of https://github.com/tabler/tabler-icons.git synced 2025-01-17 20:58:34 +01:00
tabler-icons/.build/update-readme.mjs
2023-01-22 00:02:47 +01:00

21 lines
558 B
JavaScript

import { readFileSync, writeFileSync } from 'fs'
import glob from 'glob'
import { resolve } from 'path'
import { HOME_DIR } from './helpers.mjs'
let count = glob.sync(resolve(HOME_DIR, 'icons/*.svg')).length
console.log('count', count);
const readmes = glob.sync(resolve(HOME_DIR, '{.,packages/*}/README.md'))
readmes.forEach(readme => {
let fileData = readFileSync(readme).toString()
fileData = fileData.replace(/<!--icons-count-->(.*?)<!--\/icons-count-->/, `<!--icons-count-->${count}<!--/icons-count-->`)
writeFileSync(readme, fileData)
})