diff --git a/src/discord/extensions/mods.ts b/src/discord/extensions/mods.ts index b41ec70..5c8c93a 100644 --- a/src/discord/extensions/mods.ts +++ b/src/discord/extensions/mods.ts @@ -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 { if ((await getConfig("noBundleUpdates")) == undefined ?? false) { try { @@ -108,7 +109,6 @@ export async function installModLoader(): Promise { break; } - await streamPipeline(loaderZip.body, fs.createWriteStream(zipPath)); await extract(zipPath, {dir: path.join(app.getPath("userData"), "plugins")}); diff --git a/src/setup/main.ts b/src/setup/main.ts index de85fde..35d05c6 100644 --- a/src/setup/main.ts +++ b/src/setup/main.ts @@ -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) => { diff --git a/src/setup/preload.ts b/src/setup/preload.mts similarity index 100% rename from src/setup/preload.ts rename to src/setup/preload.mts