forked from MapComplete/MapComplete
		
	replace wget with download script
This commit is contained in:
		
							parent
							
								
									ccae867353
								
							
						
					
					
						commit
						8d51d354a9
					
				
					 3 changed files with 14 additions and 3 deletions
				
			
		|  | @ -33,7 +33,6 @@ To develop and build MapComplete, you | ||||||
|     - You can [use asdf to manage your runtime versions](https://asdf-vm.com/). |     - You can [use asdf to manage your runtime versions](https://asdf-vm.com/). | ||||||
| 0. Install `npm`. Linux: `sudo apt install npm` (or your favourite package manager), Windows: install | 0. Install `npm`. Linux: `sudo apt install npm` (or your favourite package manager), Windows: install | ||||||
|    nodeJS: https://nodejs.org/en/download/ |    nodeJS: https://nodejs.org/en/download/ | ||||||
| 0. On iOS, install `wget` (`brew install wget`) |  | ||||||
| 0. Run `npm run init` which … | 0. Run `npm run init` which … | ||||||
|     - runs `npm install` |     - runs `npm install` | ||||||
|     - generates some additional dependencies and files |     - generates some additional dependencies and files | ||||||
|  |  | ||||||
|  | @ -18,8 +18,8 @@ | ||||||
|     "init": "npm ci && npm run generate && npm run generate:editor-layer-index && npm run generate:layouts && npm run clean", |     "init": "npm ci && npm run generate && npm run generate:editor-layer-index && npm run generate:layouts && npm run clean", | ||||||
|     "add-weblate-upstream": "git remote add weblate-layers https://hosted.weblate.org/git/mapcomplete/layer-translations/ ; git remote update weblate-layers", |     "add-weblate-upstream": "git remote add weblate-layers https://hosted.weblate.org/git/mapcomplete/layer-translations/ ; git remote update weblate-layers", | ||||||
|     "fix-weblate": "git remote update weblate-layers; git merge weblate-layers/master", |     "fix-weblate": "git remote update weblate-layers; git merge weblate-layers/master", | ||||||
|     "generate:editor-layer-index": "cd assets/ && wget https://osmlab.github.io/editor-layer-index/imagery.geojson --output-document=editor-layer-index.json", |     "generate:editor-layer-index": "ts-node scripts/downloadFile.ts https://osmlab.github.io/editor-layer-index/imagery.geojson assets/editor-layer-index.json", | ||||||
|     "generate:polygon-features": "cd assets/ && wget https://raw.githubusercontent.com/tyrasd/osm-polygon-features/master/polygon-features.json --output-document=polygon-features.json", |     "generate:polygon-features": "ts-node scripts/downloadFile.ts  https://raw.githubusercontent.com/tyrasd/osm-polygon-features/master/polygon-features.json assets/polygon-features.json", | ||||||
|     "generate:images": "ts-node scripts/generateIncludedImages.ts", |     "generate:images": "ts-node scripts/generateIncludedImages.ts", | ||||||
|     "generate:translations": "ts-node scripts/generateTranslations.ts", |     "generate:translations": "ts-node scripts/generateTranslations.ts", | ||||||
|     "reset:translations": "ts-node scripts/generateTranslations.ts --ignore-weblate", |     "reset:translations": "ts-node scripts/generateTranslations.ts --ignore-weblate", | ||||||
|  |  | ||||||
							
								
								
									
										12
									
								
								scripts/downloadFile.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								scripts/downloadFile.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,12 @@ | ||||||
|  | const http = require('https'); | ||||||
|  | const fs = require('fs'); | ||||||
|  | 
 | ||||||
|  | // Could use yargs to have more validation but wanted to keep it simple
 | ||||||
|  | const args = process.argv.slice(2); | ||||||
|  | const FILE_URL = args[0]; | ||||||
|  | const DESTINATION = args[1]; | ||||||
|  | 
 | ||||||
|  | console.log(`Downloading ${FILE_URL} to ${DESTINATION}`) | ||||||
|  | 
 | ||||||
|  | const file = fs.createWriteStream(DESTINATION); | ||||||
|  | http.get(FILE_URL, response=>response.pipe(file)); | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue