forked from MapComplete/MapComplete
		
	Merge develop
This commit is contained in:
		
						commit
						24e7bc95cb
					
				
					 354 changed files with 1394 additions and 86984 deletions
				
			
		|  | @ -74,7 +74,14 @@ class LayerOverviewUtils extends Script { | |||
|             sourcefile = [sourcefile] | ||||
|         } | ||||
| 
 | ||||
|         return sourcefile.some((sourcefile) => statSync(sourcefile).mtime > targetModified) | ||||
|         for (const path of sourcefile) { | ||||
|             const hasChange = statSync(path).mtime > targetModified | ||||
|             if (hasChange) { | ||||
|                 console.log("File ", targetfile, " should be updated as ", path, "has been changed") | ||||
|                 return true | ||||
|             } | ||||
|         } | ||||
|         return false | ||||
|     } | ||||
| 
 | ||||
|     writeSmallOverview( | ||||
|  | @ -180,7 +187,7 @@ class LayerOverviewUtils extends Script { | |||
|             if (key === "id") { | ||||
|                 return | ||||
|             } | ||||
|             value.id = value.id ?? key | ||||
|             value["id"] = value["id"] ?? key | ||||
|         }) | ||||
| 
 | ||||
|         return dict | ||||
|  | @ -434,30 +441,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