| 
									
										
										
										
											2021-09-26 18:21:29 +02:00
										 |  |  | import ScriptUtils from "./ScriptUtils"; | 
					
						
							| 
									
										
										
										
											2021-10-19 02:31:32 +02:00
										 |  |  | import {writeFileSync} from "fs"; | 
					
						
							| 
									
										
										
										
											2021-10-29 01:41:37 +02:00
										 |  |  | import LegacyJsonConvert from "../Models/ThemeConfig/LegacyJsonConvert"; | 
					
						
							| 
									
										
										
										
											2021-09-26 18:21:29 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-10-29 01:41:37 +02:00
										 |  |  | /* | 
					
						
							|  |  |  |  * This script reads all theme and layer files and reformats them inplace | 
					
						
							|  |  |  |  * Use with caution, make a commit beforehand! | 
					
						
							| 
									
										
										
										
											2021-09-26 19:56:40 +02:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const layerFiles = ScriptUtils.getLayerFiles(); | 
					
						
							|  |  |  | for (const layerFile of layerFiles) { | 
					
						
							| 
									
										
										
										
											2021-11-07 16:34:51 +01:00
										 |  |  |     LegacyJsonConvert.fixLayerConfig(layerFile.parsed) | 
					
						
							| 
									
										
										
										
											2021-11-07 21:20:05 +01:00
										 |  |  |     writeFileSync(layerFile.path, JSON.stringify(layerFile.parsed, null, "  ")) | 
					
						
							| 
									
										
										
										
											2021-09-26 19:56:40 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2021-09-26 19:59:51 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-09-26 19:56:40 +02:00
										 |  |  | const themeFiles = ScriptUtils.getThemeFiles() | 
					
						
							|  |  |  | for (const themeFile of themeFiles) { | 
					
						
							| 
									
										
										
										
											2021-11-07 16:34:51 +01:00
										 |  |  |     LegacyJsonConvert.fixThemeConfig(themeFile.parsed) | 
					
						
							| 
									
										
										
										
											2021-09-26 19:59:51 +02:00
										 |  |  |     writeFileSync(themeFile.path, JSON.stringify(themeFile.parsed, null, "  ")) | 
					
						
							| 
									
										
										
										
											2021-09-26 19:58:11 +02:00
										 |  |  | } |