working donwload

This commit is contained in:
karl.hudgell 2020-04-25 16:56:23 +01:00
parent f7ba26ff3a
commit a2794d0b2c
2 changed files with 21 additions and 5 deletions

View File

@ -1,5 +1,6 @@
const fs = require('fs');
const path = require('path');
const dl = require('download-file-with-progressbar');
module.exports = {
getCurrentDirectoryBase: () => {
@ -27,4 +28,19 @@ module.exports = {
console.log(err)
}
},
downloadFile: async (element) => {
option = {
dir: './data/apps',
onDone: (info)=>{
console.log(element.name + ' Downloaded')
},
onError: (err) => {
console.log('error', err);
},
onProgress: (curr, total) => {
},
}
var dd = dl(element.url, option);
}
};

View File

@ -13,7 +13,7 @@ module.exports = {
for (let element of value.removeAppsList) {
for (let element2 of compatibleApps) {
if (element === element2.name) {
console.log(element2.url)
await files.downloadFile(element2)
}
}
}