refactor: wrap validation

This commit is contained in:
Jozef Steinhübl 2024-07-29 21:08:44 +02:00
parent d9c4697ce6
commit 2cadd94599
No known key found for this signature in database
GPG Key ID: E6BC90C91973B08F

View File

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