From 1fd47d646b1d0a8f91ee5a5cfb89f9ad81d2d572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mond=C3=A9jar=20Rubio?= Date: Fri, 26 Jul 2024 18:19:45 +0200 Subject: [PATCH] Fix number of icons not updated on README when decreased (#11537) --- scripts/release/update-svgs-count.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/release/update-svgs-count.js b/scripts/release/update-svgs-count.js index 5ce295237..8d1ff897e 100644 --- a/scripts/release/update-svgs-count.js +++ b/scripts/release/update-svgs-count.js @@ -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); }