mirror of
https://github.com/zadam/trilium.git
synced 2026-01-06 06:34:25 +01:00
chore(scripts): add script to compare the two boxicons
This commit is contained in:
parent
ed229e0578
commit
8eebae0955
24
scripts/icon-packs/compare_icons.ts
Normal file
24
scripts/icon-packs/compare_icons.ts
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import { readFileSync } from "fs";
|
||||||
|
import { join } from "path";
|
||||||
|
|
||||||
|
const basePath = join(__dirname, "../../apps/server/src/services");
|
||||||
|
const oldFile = join(basePath, "icon_pack_boxicons-v2.json");
|
||||||
|
const newFile = join(basePath, "icon_pack_boxicons-v3.json");
|
||||||
|
|
||||||
|
const oldData = JSON.parse(readFileSync(oldFile, "utf-8"));
|
||||||
|
const newData = JSON.parse(readFileSync(newFile, "utf-8"));
|
||||||
|
|
||||||
|
const oldIcons = new Set(Object.keys(oldData.icons).filter(key => !key.startsWith("bxl")));
|
||||||
|
const newIcons = new Set(Object.keys(newData.icons));
|
||||||
|
|
||||||
|
const onlyInOld = [...oldIcons].filter(x => !newIcons.has(x));
|
||||||
|
const onlyInNew = [...newIcons].filter(x => !oldIcons.has(x));
|
||||||
|
|
||||||
|
console.log("## Icons only in old manifest\n", onlyInOld.map(x => `- ${x}`).join("\n"));
|
||||||
|
// console.log("## Icons only in new manifest\n", onlyInNew.map(x => `- ${x}`).join("\n"));
|
||||||
|
|
||||||
|
if (onlyInOld.length === 0 && onlyInNew.length === 0) {
|
||||||
|
console.log("The icon manifests are identical in terms of icon keys.");
|
||||||
|
} else {
|
||||||
|
console.log("There are differences between the icon manifests.");
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user