Merge pull request #622 from RayBB/replace-wget

replace wget with download script
This commit is contained in:
Pieter Vander Vennet 2022-01-17 01:01:13 +01:00 committed by GitHub
commit 7bc01b783b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 3 deletions

12
scripts/downloadFile.ts Normal file
View 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));