mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-12-16 01:10:30 +02:00
Fix number of icons not updated on README when decreased (#11537)
This commit is contained in:
parent
e7ebb48de8
commit
1fd47d646b
@ -32,12 +32,12 @@ try {
|
||||
const overNIconsInReadme = Number.parseInt(match[1], 10);
|
||||
const iconsData = await getIconsData();
|
||||
const nIcons = iconsData.length;
|
||||
const newNIcons = overNIconsInReadme + updateRange;
|
||||
const nIconsRounded = Math.floor(nIcons / updateRange) * updateRange;
|
||||
|
||||
if (nIcons > newNIcons) {
|
||||
if (overNIconsInReadme !== nIconsRounded) {
|
||||
const newContent = readmeContent.replace(
|
||||
regexMatcher,
|
||||
`Over ${newNIcons} `,
|
||||
`Over ${nIconsRounded} `,
|
||||
);
|
||||
await fs.writeFile(readmeFile, newContent);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user