From cd9634a67b864b2bc5051bd25ede05f9f342267a Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Tue, 12 Mar 2024 23:35:07 +0100 Subject: [PATCH] Attempt to fix build --- scripts/generateFavouritesLayer.ts | 44 ++++++++++++++++-------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/scripts/generateFavouritesLayer.ts b/scripts/generateFavouritesLayer.ts index 0c0e3c008..d24fcd963 100644 --- a/scripts/generateFavouritesLayer.ts +++ b/scripts/generateFavouritesLayer.ts @@ -40,6 +40,26 @@ export class GenerateFavouritesLayer extends Script { } } + async main(args: string[]): Promise { + console.log("Generating the favourite layer: stealing _all_ tagRenderings") + const proto = this.readLayer("favourite/favourite.proto.json") + this.addTagRenderings(proto) + this.addTitle(proto) + proto.titleIcons = this.generateTitleIcons() + const targetContent = JSON.stringify(proto, null, " ") + const path = "./assets/layers/favourite/favourite.json" + if (existsSync(path)) { + if (readFileSync(path, "utf8") === targetContent) { + console.log( + "Already existing favourite layer is identical to the generated one, not writing" + ) + return + } + } + console.log("Written favourite layer to", path) + writeFileSync(path, targetContent) + } + private sortMappings(mappings: MappingConfigJson[]): MappingConfigJson[] { const sortedMappings: MappingConfigJson[] = [...mappings] sortedMappings.sort((a, b) => { @@ -200,6 +220,10 @@ export class GenerateFavouritesLayer extends Script { if (titleIcon["labels"]?.indexOf("defaults") >= 0) { continue } + if (titleIcon.id === "iconsdefaults") { + continue + } + if (titleIcon.id === "rating") { if (!seenTitleIcons.has("rating")) { titleIcons.unshift(...iconsLibrary.get("rating")) @@ -302,26 +326,6 @@ export class GenerateFavouritesLayer extends Script { } } - async main(args: string[]): Promise { - console.log("Generating the favourite layer: stealing _all_ tagRenderings") - const proto = this.readLayer("favourite/favourite.proto.json") - this.addTagRenderings(proto) - this.addTitle(proto) - proto.titleIcons = this.generateTitleIcons() - const targetContent = JSON.stringify(proto, null, " ") - const path = "./assets/layers/favourite/favourite.json" - if (existsSync(path)) { - if (readFileSync(path, "utf8") === targetContent) { - console.log( - "Already existing favourite layer is identical to the generated one, not writing" - ) - return - } - } - console.log("Written favourite layer to", path) - writeFileSync(path, targetContent) - } - private readLayer(path: string): LayerConfigJson { try { return JSON.parse(readFileSync("./assets/layers/" + path, "utf8"))