[AsarUpdate] Make generic (support various channels of updates)
This commit is contained in:
parent
7c11adddc4
commit
af9bec3783
1 changed files with 2 additions and 2 deletions
|
@ -7,14 +7,14 @@ const { join } = require('path');
|
|||
const asarPath = join(require.main.filename, '..');
|
||||
const downloadPath = join(asarPath, '..', 'app.asar.download');
|
||||
|
||||
const asarUrl = 'https://github.com/GooseMod/OpenAsar/releases/download/nightly/app.asar';
|
||||
const asarUrl = `https://github.com/GooseMod/OpenAsar/releases/download/${oaVersion.split('-')[0]}/app.asar`;
|
||||
|
||||
const getAsarHash = () => crypto.createHash('sha512').update(fs.readFileSync(asarPath)).digest('hex');
|
||||
|
||||
module.exports = async () => { // (Try) update asar
|
||||
log('AsarUpdate', 'Updating...');
|
||||
|
||||
if (!oaVersion.startsWith('nightly-')) return log('AsarUpdate', 'Non-standard version');
|
||||
if (!oaVersion.includes('-')) return log('AsarUpdate', 'Non-standard version');
|
||||
|
||||
const originalHash = getAsarHash();
|
||||
|
||||
|
|
Loading…
Reference in a new issue