fix: check if valid semver and add bun-v

This commit is contained in:
Jozef Steinhübl 2024-07-29 21:07:28 +02:00
parent 019399b06a
commit e53a660495
No known key found for this signature in database
GPG Key ID: E6BC90C91973B08F

View File

@ -183,6 +183,8 @@ async function getDownloadUrl(options: Input): Promise<string> {
else tag = `bun-v${tags.filter((t) => satisfies(t, version)).at(-1)}`;
}
if (validate(tag)) tag = `bun-v${tag}`;
const eversion = encodeURIComponent(tag ?? version);
const eos = encodeURIComponent(os ?? getPlatform());
const earch = encodeURIComponent(arch ?? getArchitecture());