Skip to content

Commit

Permalink
readme fix
Browse files Browse the repository at this point in the history
  • Loading branch information
codecalm committed Mar 10, 2024
1 parent db2bb3f commit acd82d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .build/update-readme.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ import { glob } from 'glob'
import { resolve } from 'path'
import { HOME_DIR, ICONS_SRC_DIR } from './helpers.mjs'

let count = glob.sync(resolve(ICONS_SRC_DIR, '**/*.svg')).length
let count = glob.sync(resolve(ICONS_SRC_DIR, '**/*.svg')).length,
outlineCount = glob.sync(resolve(ICONS_SRC_DIR, '**/outline/*.svg')).length,
filledCount = glob.sync(resolve(ICONS_SRC_DIR, '**/filled/*.svg')).length

console.log('count', count);
console.log('filledCount', filledCount);
console.log('outlineCount', outlineCount);

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-->`)
.replace(/<!--icons-count-outline-->(.*?)<!--\/icons-count-outline-->/, `<!--icons-count-outline-->${outlineCount}<!--/icons-count-outline-->`)
.replace(/<!--icons-count-filled-->(.*?)<!--\/icons-count-filled-->/, `<!--icons-count-filled-->${filledCount}<!--/icons-count-filled-->`)

writeFileSync(readme, fileData)
})
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

## Preview

### Outline version
### Outline version (<!--icons-count-outline-->4547<!--/icons-count-outline--> icons)

<p align="center">
<picture>
Expand All @@ -31,7 +31,7 @@
</picture>
</p>

### Filled version
### Filled version (<!--icons-count-filled-->653<!--/icons-count-filled--> icons)

<p align="center">
<picture>
Expand Down

0 comments on commit acd82d6

Please sign in to comment.