First commit of the new Insider version on docker

This commit is contained in:
2024-03-27 18:20:08 +01:00
parent 7637b068f9
commit be57c29e6e
61 changed files with 13693 additions and 1 deletions

20
models/updateHelper.js Normal file
View File

@@ -0,0 +1,20 @@
const fs = require('fs');
const fetch = (...args) => import('node-fetch').then(({ default: fetch }) => fetch(...args));
const AdmZip = require('adm-zip');
const { logger, ErrorLogger, logRequestInfo } = require('../config/logs');
function compareAndUpdate(currentPath, updatedPath) {
}
async function downloadUpdate(updateUrl, destinationPath) {
const response = await fetch(updateUrl);
const buffer = await response.buffer();
fs.writeFileSync(destinationPath, buffer);
}
function unzipUpdate(zipPath, extractionPath) {
const zip = new AdmZip(zipPath);
zip.extractAllTo(extractionPath, /*overwrite*/ true);
}
module.exports = { compareAndUpdate, downloadUpdate, unzipUpdate };