mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-11-16 00:59:07 +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 overNIconsInReadme = Number.parseInt(match[1], 10);
|
||||||
const iconsData = await getIconsData();
|
const iconsData = await getIconsData();
|
||||||
const nIcons = iconsData.length;
|
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(
|
const newContent = readmeContent.replace(
|
||||||
regexMatcher,
|
regexMatcher,
|
||||||
`Over ${newNIcons} `,
|
`Over ${nIconsRounded} `,
|
||||||
);
|
);
|
||||||
await fs.writeFile(readmeFile, newContent);
|
await fs.writeFile(readmeFile, newContent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user