app download + building script
This commit is contained in:
14
download.js
Normal file
14
download.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const axios = require('axios').default;
|
||||
const unzip = require('unzip-stream');
|
||||
const fs = require('fs');
|
||||
const download = require('download');
|
||||
|
||||
axios.get('https://git.odit.services/api/v1/repos/lfk/scanclient/releases').then(({ data }) => {
|
||||
(async () => {
|
||||
const download_file = data[0].assets.find((a) => a.name === 'dist.zip').browser_download_url;
|
||||
fs.writeFileSync('app.zip', await download(download_file));
|
||||
fs.createReadStream('app.zip').pipe(unzip.Parse()).on('entry', () => {
|
||||
fs.createReadStream('app.zip').pipe(unzip.Extract({ path: './appcode/' }));
|
||||
});
|
||||
})();
|
||||
});
|
||||
Reference in New Issue
Block a user