From 782ae609393a3e26a1dc91c98c1ed419f15fc6e4 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 29 Jun 2023 01:43:26 +0200 Subject: [PATCH] Scripts: improve logging of generateLayerOverview --- scripts/generateLayerOverview.ts | 41 +++++++++++++++----------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/scripts/generateLayerOverview.ts b/scripts/generateLayerOverview.ts index 144d429f3..72ae082cf 100644 --- a/scripts/generateLayerOverview.ts +++ b/scripts/generateLayerOverview.ts @@ -434,30 +434,27 @@ class LayerOverviewUtils extends Script { const themeInfo = themeFiles[i] const themePath = themeInfo.path let themeFile = themeInfo.parsed - console.log(`Validating ${i}/${themeFiles.length} '${themeInfo.parsed.id}'`) - { - const targetPath = - LayerOverviewUtils.themePath + - "/" + - themePath.substring(themePath.lastIndexOf("/")) - const usedLayers = Array.from( - LayerOverviewUtils.extractLayerIdsFrom(themeFile, false) - ).map((id) => LayerOverviewUtils.layerPath + id + ".json") - if (!forceReload && !this.shouldBeUpdated([themePath, ...usedLayers], targetPath)) { - fixed.set( - themeFile.id, - JSON.parse( - readFileSync( - LayerOverviewUtils.themePath + themeFile.id + ".json", - "utf8" - ) - ) + + const targetPath = + LayerOverviewUtils.themePath + "/" + themePath.substring(themePath.lastIndexOf("/")) + const usedLayers = Array.from( + LayerOverviewUtils.extractLayerIdsFrom(themeFile, false) + ).map((id) => LayerOverviewUtils.layerPath + id + ".json") + + if (!forceReload && !this.shouldBeUpdated([themePath, ...usedLayers], targetPath)) { + fixed.set( + themeFile.id, + JSON.parse( + readFileSync(LayerOverviewUtils.themePath + themeFile.id + ".json", "utf8") ) - skippedThemes.push(themeFile.id) - continue - } - recompiledThemes.push(themeFile.id) + ) + console.log("Skipping", themeFile.id) + skippedThemes.push(themeFile.id) + continue } + console.log(`Validating ${i}/${themeFiles.length} '${themeInfo.parsed.id}'`) + + recompiledThemes.push(themeFile.id) new PrevalidateTheme().convertStrict(themeFile, themePath) try {