forked from MapComplete/MapComplete
		
	Scripts: improve logging of generateLayerOverview
This commit is contained in:
		
							parent
							
								
									006f69561a
								
							
						
					
					
						commit
						782ae60939
					
				
					 1 changed files with 19 additions and 22 deletions
				
			
		|  | @ -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 { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue