From 08e682cb56e8cb48cec2aa715045a6bd0c81bfc4 Mon Sep 17 00:00:00 2001 From: kcmartin Date: Tue, 21 Apr 2026 00:14:22 +0000 Subject: [PATCH 1/2] Fix broken manual installation instructions The checksum verification commands failed because the .sha256 file references a subfolder path (e.g. sprite-darwin-arm64/sprite-darwin-arm64.tar.gz) while the downloaded file is in the current directory. Fixed by piping through awk to extract the hash and pair it with the correct local filename. Also added line continuations to long curl commands to prevent copy-paste issues from visual wrapping, and added error handling to the version fetch. Closes #162 --- src/components/CliDownloads.astro | 12 +++++------- src/lib/cli-releases.ts | 15 +++++++++++++-- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/components/CliDownloads.astro b/src/components/CliDownloads.astro index 2de3c74..4f253c8 100644 --- a/src/components/CliDownloads.astro +++ b/src/components/CliDownloads.astro @@ -16,12 +16,11 @@ const instructions = [ steps: [ { label: 'Download the binary', - code: `curl -LO ${darwinArm64.url}`, + code: `curl -LO \\\n ${darwinArm64.url}`, }, { label: 'Verify checksum (recommended)', - code: `curl -LO ${darwinArm64.checksumUrl} -shasum -a 256 -c ${darwinArm64.filename}.sha256`, + code: `curl -sL ${darwinArm64.checksumUrl} \\\n | awk '{print $1 " ${darwinArm64.filename}"}' | shasum -a 256 -c`, }, { label: 'Extract and install', @@ -36,12 +35,11 @@ sudo mv sprite /usr/local/bin/`, steps: [ { label: 'Download the binary', - code: `curl -LO ${linuxAmd64.url}`, + code: `curl -LO \\\n ${linuxAmd64.url}`, }, { label: 'Verify checksum (recommended)', - code: `curl -LO ${linuxAmd64.checksumUrl} -sha256sum -c ${linuxAmd64.filename}.sha256`, + code: `curl -sL ${linuxAmd64.checksumUrl} \\\n | awk '{print $1 " ${linuxAmd64.filename}"}' | sha256sum -c`, }, { label: 'Extract and install', @@ -56,7 +54,7 @@ sudo mv sprite /usr/local/bin/`, steps: [ { label: 'Download the binary', - code: `Invoke-WebRequest -Uri "${windowsAmd64.url}" -OutFile "${windowsAmd64.filename}"`, + code: `Invoke-WebRequest \`\n -Uri "${windowsAmd64.url}" \`\n -OutFile "${windowsAmd64.filename}"`, }, { label: 'Extract to your bin directory', diff --git a/src/lib/cli-releases.ts b/src/lib/cli-releases.ts index 07a1d8f..8372385 100644 --- a/src/lib/cli-releases.ts +++ b/src/lib/cli-releases.ts @@ -22,6 +22,18 @@ const PLATFORMS = [ { platform: 'Windows', arch: 'ARM64', key: 'windows-arm64' }, ] as const; +async function fetchLatestVersion(): Promise { + const response = await fetch(`${BINARIES_BASE_URL}/client/rc.txt`); + if (!response.ok) { + throw new Error(`Failed to fetch latest RC version: ${response.statusText}`); + } + const version = (await response.text()).trim(); + if (!version) { + throw new Error('Empty version string from rc.txt'); + } + return version; +} + function buildBinaries(version: string): CliBinary[] { return PLATFORMS.map(({ platform, arch, key }) => { const ext = key.startsWith('windows') ? 'zip' : 'tar.gz'; @@ -38,8 +50,7 @@ function buildBinaries(version: string): CliBinary[] { } export async function getLatestRcRelease(): Promise { - const response = await fetch(`${BINARIES_BASE_URL}/client/rc.txt`); - const version = await response.text(); + const version = await fetchLatestVersion(); return { version, From 42561a43f2ebf4335b817f70843edf88f0ffcdf1 Mon Sep 17 00:00:00 2001 From: kcmartin Date: Tue, 21 Apr 2026 00:14:22 +0000 Subject: [PATCH 2/2] Fix lint formatting in cli-releases.ts --- src/lib/cli-releases.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/cli-releases.ts b/src/lib/cli-releases.ts index 8372385..2978b8f 100644 --- a/src/lib/cli-releases.ts +++ b/src/lib/cli-releases.ts @@ -25,7 +25,9 @@ const PLATFORMS = [ async function fetchLatestVersion(): Promise { const response = await fetch(`${BINARIES_BASE_URL}/client/rc.txt`); if (!response.ok) { - throw new Error(`Failed to fetch latest RC version: ${response.statusText}`); + throw new Error( + `Failed to fetch latest RC version: ${response.statusText}`, + ); } const version = (await response.text()).trim(); if (!version) {