fix: modloader downloading

This commit is contained in:
smartfrigde 2024-05-30 18:52:54 +02:00
parent a49ae6b378
commit 871202aad1
3 changed files with 3 additions and 3 deletions

View file

@ -3,8 +3,9 @@ import extract from "extract-zip";
import path from "path";
import {getConfig} from "../../common/config";
import fs from "fs";
import {promisify} from "node:util";
import {pipeline} from "stream";
const streamPipeline = pipeline;
const streamPipeline = promisify(pipeline);
async function updateModBundle(): Promise<void> {
if ((await getConfig("noBundleUpdates")) == undefined ?? false) {
try {
@ -108,7 +109,6 @@ export async function installModLoader(): Promise<void> {
break;
}
await streamPipeline(loaderZip.body, fs.createWriteStream(zipPath));
await extract(zipPath, {dir: path.join(app.getPath("userData"), "plugins")});

View file

@ -17,7 +17,7 @@ export function createSetupWindow(): void {
webPreferences: {
sandbox: false,
spellcheck: false,
preload: path.join(import.meta.dirname, "preload.js")
preload: path.join(import.meta.dirname, "preload.mjs")
}
});
ipcMain.on("saveSettings", (_event, args: Settings) => {