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