forked from MapComplete/MapComplete
		
	
		
			
	
	
		
			22 lines
		
	
	
	
		
			626 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			22 lines
		
	
	
	
		
			626 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
								 | 
							
								import Script from "./Script"
							 | 
						||
| 
								 | 
							
								import Constants from "../src/Models/Constants"
							 | 
						||
| 
								 | 
							
								import { writeFileSync } from "fs"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class PrepareServiceWorker extends Script {
							 | 
						||
| 
								 | 
							
								    constructor() {
							 | 
						||
| 
								 | 
							
								        super("Super various little jobs to help the service worker")
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								    public async main() {
							 | 
						||
| 
								 | 
							
								        const v = Constants.vNumber
							 | 
						||
| 
								 | 
							
								        writeFileSync("./src/service-worker/SWGenerated.ts",
							 | 
						||
| 
								 | 
							
								            ["export class SWGenerated {",
							 | 
						||
| 
								 | 
							
								                "// generated by scripts/prepareServiceWorker.ts",
							 | 
						||
| 
								 | 
							
								                "static vNumber = " + JSON.stringify(v), "}"].join("\n")
							 | 
						||
| 
								 | 
							
								            , "utf8")
							 | 
						||
| 
								 | 
							
								    }
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								new PrepareServiceWorker().run()
							 |