diff --git a/packages/cli/src/commands/serve.ts b/packages/cli/src/commands/serve.ts index e24a5526a3..4d0fc10c65 100644 --- a/packages/cli/src/commands/serve.ts +++ b/packages/cli/src/commands/serve.ts @@ -86,29 +86,33 @@ async function downloadWebDist(version: string, targetDir: string): Promise { - throw new Error( - `Network error fetching checksums from ${checksumsUrl}: ${(err as Error).message}` - ); - }); + // Download checksums and tarball in parallel + console.log(`Downloading ${tarballUrl}...`); + const [checksumsRes, tarballRes] = await Promise.all([ + fetch(checksumsUrl).catch((err: unknown) => { + throw new Error( + `Network error fetching checksums from ${checksumsUrl}: ${(err as Error).message}` + ); + }), + fetch(tarballUrl).catch((err: unknown) => { + throw new Error( + `Network error fetching tarball from ${tarballUrl}: ${(err as Error).message}` + ); + }), + ]); if (!checksumsRes.ok) { throw new Error( `Failed to download checksums: ${checksumsRes.status} ${checksumsRes.statusText}` ); } - const checksumsText = await checksumsRes.text(); - const expectedHash = parseChecksum(checksumsText, 'archon-web.tar.gz'); - - // Download tarball - console.log(`Downloading ${tarballUrl}...`); - const tarballRes = await fetch(tarballUrl).catch((err: unknown) => { - throw new Error(`Network error fetching tarball from ${tarballUrl}: ${(err as Error).message}`); - }); if (!tarballRes.ok) { throw new Error(`Failed to download web UI: ${tarballRes.status} ${tarballRes.statusText}`); } - const tarballBuffer = await tarballRes.arrayBuffer(); + const [checksumsText, tarballBuffer] = await Promise.all([ + checksumsRes.text(), + tarballRes.arrayBuffer(), + ]); + const expectedHash = parseChecksum(checksumsText, 'archon-web.tar.gz'); // Verify checksum const hasher = new Bun.CryptoHasher('sha256'); diff --git a/packages/cli/src/commands/setup.ts b/packages/cli/src/commands/setup.ts index b94529cd4c..cc0b138a61 100644 --- a/packages/cli/src/commands/setup.ts +++ b/packages/cli/src/commands/setup.ts @@ -1203,7 +1203,7 @@ export function copyArchonSkill(targetPath: string): void { function trySpawn( command: string, args: string[], - options: { detached: boolean; stdio: 'ignore'; shell?: boolean } + options: { detached: boolean; stdio: 'ignore' } ): boolean { try { const child: ChildProcess = spawn(command, args, options); @@ -1238,7 +1238,6 @@ function spawnWindowsTerminal(repoPath: string): SpawnResult { trySpawn('cmd.exe', ['/c', 'start', '""', '/D', repoPath, 'cmd', '/k', 'archon setup'], { detached: true, stdio: 'ignore', - shell: true, }) ) { return { success: true }; diff --git a/packages/paths/src/update-check.ts b/packages/paths/src/update-check.ts index 46652eb0d8..1e7da7dd41 100644 --- a/packages/paths/src/update-check.ts +++ b/packages/paths/src/update-check.ts @@ -1,5 +1,5 @@ import { join } from 'path'; -import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs'; +import { readFileSync, writeFileSync, mkdirSync } from 'fs'; import { getArchonHome } from './archon-paths'; import { createLogger } from './logger'; @@ -30,7 +30,6 @@ function getCachePath(): string { function readCache(): UpdateCheckCache | null { const cachePath = getCachePath(); try { - if (!existsSync(cachePath)) return null; const raw = readFileSync(cachePath, 'utf-8'); const data = JSON.parse(raw) as UpdateCheckCache; if (!data.latestVersion || !data.releaseUrl || typeof data.checkedAt !== 'number') {