Scripts: improve logging of generateLayerOverview

This commit is contained in:
Pieter Vander Vennet 2023-06-29 01:43:26 +02:00
parent 006f69561a
commit 782ae60939

View file

@ -434,30 +434,27 @@ class LayerOverviewUtils extends Script {
const themeInfo = themeFiles[i] const themeInfo = themeFiles[i]
const themePath = themeInfo.path const themePath = themeInfo.path
let themeFile = themeInfo.parsed let themeFile = themeInfo.parsed
console.log(`Validating ${i}/${themeFiles.length} '${themeInfo.parsed.id}'`)
{ const targetPath =
const targetPath = LayerOverviewUtils.themePath + "/" + themePath.substring(themePath.lastIndexOf("/"))
LayerOverviewUtils.themePath + const usedLayers = Array.from(
"/" + LayerOverviewUtils.extractLayerIdsFrom(themeFile, false)
themePath.substring(themePath.lastIndexOf("/")) ).map((id) => LayerOverviewUtils.layerPath + id + ".json")
const usedLayers = Array.from(
LayerOverviewUtils.extractLayerIdsFrom(themeFile, false) if (!forceReload && !this.shouldBeUpdated([themePath, ...usedLayers], targetPath)) {
).map((id) => LayerOverviewUtils.layerPath + id + ".json") fixed.set(
if (!forceReload && !this.shouldBeUpdated([themePath, ...usedLayers], targetPath)) { themeFile.id,
fixed.set( JSON.parse(
themeFile.id, readFileSync(LayerOverviewUtils.themePath + themeFile.id + ".json", "utf8")
JSON.parse(
readFileSync(
LayerOverviewUtils.themePath + themeFile.id + ".json",
"utf8"
)
)
) )
skippedThemes.push(themeFile.id) )
continue console.log("Skipping", themeFile.id)
} skippedThemes.push(themeFile.id)
recompiledThemes.push(themeFile.id) continue
} }
console.log(`Validating ${i}/${themeFiles.length} '${themeInfo.parsed.id}'`)
recompiledThemes.push(themeFile.id)
new PrevalidateTheme().convertStrict(themeFile, themePath) new PrevalidateTheme().convertStrict(themeFile, themePath)
try { try {