diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-03 09:10:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-05-03 09:10:03 +0000 |
commit | 9aeff034f5cdf4e22090904bf9dfecf439b34658 (patch) | |
tree | 7ed7a2f5bc0291104a79f90f547c4b250e50c21b /build/check-icons.js | |
parent | Releasing debian version 1.10.4+dfsg-1. (diff) | |
download | bootstrap-icons-9aeff034f5cdf4e22090904bf9dfecf439b34658.tar.xz bootstrap-icons-9aeff034f5cdf4e22090904bf9dfecf439b34658.zip |
Merging upstream version 1.10.5+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'build/check-icons.js')
-rwxr-xr-x | build/check-icons.js | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/build/check-icons.js b/build/check-icons.js deleted file mode 100755 index 73f1a5b..0000000 --- a/build/check-icons.js +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env node - -'use strict' - -const fs = require('node:fs').promises -const path = require('node:path') -const process = require('node:process') -const picocolors = require('picocolors') - -const fontJsonPath = path.join(__dirname, '../font/bootstrap-icons.json') -const iconsDir = path.join(__dirname, '../icons/') - -;(async () => { - try { - const basename = path.basename(__filename) - const timeLabel = picocolors.cyan(`[${basename}] finished`) - - console.log(picocolors.cyan(`[${basename}] started`)) - console.time(timeLabel) - - const fontJsonString = await fs.readFile(fontJsonPath, 'utf8') - const fontJson = JSON.parse(fontJsonString) - const svgFiles = await fs.readdir(iconsDir) - - const jsonIconList = Object.keys(fontJson) - const svgIconList = svgFiles.map(svg => path.basename(svg, path.extname(svg))) - - const onlyInJson = jsonIconList.filter(icon => !svgIconList.includes(icon)) - const onlyInSvg = svgIconList.filter(icon => !jsonIconList.includes(icon)) - - if (onlyInJson.length === 0 || onlyInSvg === 0) { - console.log(picocolors.green('Success, found no differences!')) - console.timeEnd(timeLabel) - - return - } - - if (onlyInJson.length > 0) { - console.error(picocolors.red(`Found additional icons in ${fontJsonPath}:`)) - - for (const icon of onlyInJson) { - console.log(` - ${picocolors.red(icon)}`) - } - } - - if (onlyInSvg.length > 0) { - console.error(picocolors.red('Found additional icons in SVG files:')) - - for (const icon of onlyInSvg) { - console.log(` - ${picocolors.red(icon)}`) - } - } - - process.exit(1) - } catch (error) { - console.error(error) - process.exit(1) - } -})() |