From 7e90058e7aa8b6bf7251832a2713e675f5d1619c Mon Sep 17 00:00:00 2001 From: MiTHRAL Date: Tue, 21 Apr 2026 20:05:01 -0400 Subject: [PATCH] fix: move installDir declaration before use (TDZ crash in updater) Co-Authored-By: Claude Sonnet 4.6 --- src/native/updater.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/native/updater.ts b/src/native/updater.ts index 98ccff3..e9c5f49 100644 --- a/src/native/updater.ts +++ b/src/native/updater.ts @@ -79,11 +79,11 @@ async function downloadAndInstall(url: string, version: string) { const res = await fetch(url); if (!res.ok) throw new Error(`Download failed: ${res.status}`); + const installDir = dirname(process.execPath); + await pipeline(Readable.fromWeb(res.body as Parameters[0]), createWriteStream(zipPath)); console.log(`[updater] download complete, extracting to ${installDir}`); - const installDir = dirname(process.execPath); - await new Promise((resolve, reject) => { const cmd = process.platform === "win32"