fix: duplicate v

This commit is contained in:
Jozef Steinhübl 2024-07-29 21:00:54 +02:00
parent 4d53c4d41f
commit 0d021b0c4f
No known key found for this signature in database
GPG Key ID: E6BC90C91973B08F

View File

@ -171,7 +171,7 @@ async function getDownloadUrl(options: Input): Promise<string> {
(tag) =>
tag.ref.startsWith("refs/tags/bun-v") || tag.ref === "refs/tags/canary"
)
.map((item) => item.ref.replace(/refs\/tags\/(bun-)?/g, ""));
.map((item) => item.ref.replace(/refs\/tags\/(bun-v)?/g, ""));
const { version, os, arch, avx2, profile } = options;
@ -180,7 +180,7 @@ async function getDownloadUrl(options: Input): Promise<string> {
tags = tags.filter((t) => validate(t)).sort(compareVersions);
if (version === "latest") tag = `bun-v${tags.at(-1)}`;
else tag = `bun-${tags.filter((t) => satisfies(t, version)).at(-1)}`;
else tag = `bun-v${tags.filter((t) => satisfies(t, version)).at(-1)}`;
}
const eversion = encodeURIComponent(tag ?? version);