From 16da5d6d36ceb857fb224f639c1a67ba41197099 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Fri, 18 Feb 2022 03:19:05 +0100 Subject: [PATCH] Re-enable images warning, add argument to script --- Models/ThemeConfig/Conversion/Validation.ts | 2 +- scripts/fixImagesInTagRenderings.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Models/ThemeConfig/Conversion/Validation.ts b/Models/ThemeConfig/Conversion/Validation.ts index a0a3aff48..2e87d706c 100644 --- a/Models/ThemeConfig/Conversion/Validation.ts +++ b/Models/ThemeConfig/Conversion/Validation.ts @@ -291,7 +291,7 @@ export class ValidateTagRenderings extends Fuse { super("Various validation on tagRenderingConfigs", // TODO enable these checks again // new DetectShadowedMappings(), - // new DetectMappingsWithImages() e + new DetectMappingsWithImages() ); } } diff --git a/scripts/fixImagesInTagRenderings.ts b/scripts/fixImagesInTagRenderings.ts index be5e58e43..1a7a2dd3f 100644 --- a/scripts/fixImagesInTagRenderings.ts +++ b/scripts/fixImagesInTagRenderings.ts @@ -3,6 +3,7 @@ import {DesugaringStep} from "../Models/ThemeConfig/Conversion/Conversion"; import {LayerConfigJson} from "../Models/ThemeConfig/Json/LayerConfigJson"; import {Utils} from "../Utils"; import Translations from "../UI/i18n/Translations"; +import TagRenderingConfig from "../Models/ThemeConfig/TagRenderingConfig"; class ConvertImagesToIcon extends DesugaringStep { private _iconClass: string; @@ -55,11 +56,12 @@ function main() { args.splice(0, 2) const path = args[0] const iconClass = args[1] ?? "small" + const targetFile = args[2] ?? path + ".autoconverted.json" console.log("Fixing images in " + path) const parsed = JSON.parse(readFileSync(path, "UTF8")) const converted = new ConvertImagesToIcon(iconClass).convertStrict(parsed, "While running the fixImagesInTagRenderings-script") - writeFileSync(path + ".autoconverted.json", JSON.stringify(converted, null, " ")) - console.log("Written fixed version to " + path + ".autoconverted.json") + writeFileSync(targetFile, JSON.stringify(converted, null, " ")) + console.log("Written fixed version to " + targetFile) } main(); \ No newline at end of file