fix install again

This commit is contained in:
2026-09-10 13:48:01 +02:00
parent f48794c2cc
commit fa3d0da80b
2 changed files with 16 additions and 2 deletions
+3 -1
View File
@@ -26,7 +26,9 @@ if [[ ! "$checksum" =~ ^[a-fA-F0-9]{64}$ ]]; then
printf 'Invalid release checksum\n' >&2
exit 1
fi
if ! (cd "$install" && printf '%s stanp-opencode.tgz\n' "$checksum" | sha256sum --check --status); then
hash_output=$(sha256sum "$install/stanp-opencode.tgz")
read -r actual _ <<< "$hash_output"
if [[ ! "$actual" =~ ^[a-fA-F0-9]{64}$ || "$actual" != "$checksum" ]]; then
printf 'Release checksum mismatch; installation unchanged\n' >&2
exit 1
fi
+13 -1
View File
@@ -145,10 +145,22 @@ if [[ -n "$output" ]]; then
else
cat "$FIXTURE_DIR/$source"
fi
`,
),
writeFile(
join(bin, "sha256sum"),
`#!/usr/bin/env bash
if [[ "\${1:-}" == -* ]]; then
printf 'usage: sha256sum [-bctwz] [files ...]\n' >&2
exit 1
fi
PATH="\${PATH#*:}"
export PATH
exec sha256sum "$@"
`,
),
]);
await chmod(join(bin, "curl"), 0o755);
await Promise.all([chmod(join(bin, "curl"), 0o755), chmod(join(bin, "sha256sum"), 0o755)]);
const result = await run(["bash", installer], directory, env);
return { directory, config, env, result };
}