fix: move installDir declaration before use (TDZ crash in updater)
All checks were successful
Build & Release / build (push) Successful in 2m58s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MiTHRAL 2026-04-21 20:05:01 -04:00
parent ec61bbe5d5
commit 7e90058e7a

View file

@ -79,11 +79,11 @@ async function downloadAndInstall(url: string, version: string) {
const res = await fetch(url); const res = await fetch(url);
if (!res.ok) throw new Error(`Download failed: ${res.status}`); if (!res.ok) throw new Error(`Download failed: ${res.status}`);
const installDir = dirname(process.execPath);
await pipeline(Readable.fromWeb(res.body as Parameters<typeof Readable.fromWeb>[0]), createWriteStream(zipPath)); await pipeline(Readable.fromWeb(res.body as Parameters<typeof Readable.fromWeb>[0]), createWriteStream(zipPath));
console.log(`[updater] download complete, extracting to ${installDir}`); console.log(`[updater] download complete, extracting to ${installDir}`);
const installDir = dirname(process.execPath);
await new Promise<void>((resolve, reject) => { await new Promise<void>((resolve, reject) => {
const cmd = const cmd =
process.platform === "win32" process.platform === "win32"