asarUpdate: clean up old code

This commit is contained in:
Ducko 2022-09-28 13:33:26 +01:00
parent 73fcc84e25
commit 045f9db914

View file

@ -1,6 +1,5 @@
const request = require('request'); const request = require('request');
const fs = require('original-fs'); // Use original-fs, not Electron's modified fs const fs = require('original-fs'); // Use original-fs, not Electron's modified fs
// const { createHash } = require('crypto');
const { join } = require('path'); const { join } = require('path');
const asarPath = join(require.main.filename, '..'); const asarPath = join(require.main.filename, '..');
@ -8,15 +7,11 @@ const downloadPath = join(asarPath, '..', 'app.asar.download');
const asarUrl = `https://github.com/GooseMod/OpenAsar/releases/download/${oaVersion.split('-')[0]}/app.asar`; const asarUrl = `https://github.com/GooseMod/OpenAsar/releases/download/${oaVersion.split('-')[0]}/app.asar`;
// const getAsarHash = () => createHash('sha512').update(fs.readFileSync(asarPath)).digest('hex');
module.exports = async () => { // (Try) update asar module.exports = async () => { // (Try) update asar
log('AsarUpdate', 'Updating...'); log('AsarUpdate', 'Updating...');
if (!oaVersion.includes('-')) return; if (!oaVersion.includes('-')) return;
// const originalHash = getAsarHash();
await new Promise((res) => { await new Promise((res) => {
const file = fs.createWriteStream(downloadPath); const file = fs.createWriteStream(downloadPath);