feat: add plugin download endpoint and improve download URL construction

This commit is contained in:
2026-02-01 02:49:06 +00:00
parent 65b0de63a9
commit 2473f3f708
2 changed files with 96 additions and 6 deletions

View File

@@ -5,7 +5,7 @@ export function buildDownloadUrl(repoEntry, version, sourceType = "release") {
if (repoEntry.provider === "gitea") {
const sanitizedBase = (repoEntry.baseUrl || "").replace(/\/$/, "");
const [owner, repo] = ownerRepo.split("/");
return `${sanitizedBase}/repos/${owner}/${repo}/archive/${version}.zip`;
return `${sanitizedBase}/${owner}/${repo}/archive/${version}.zip`;
}
const refType = sourceType === "release" ? "tags" : "heads";
return `https://codeload.github.com/${ownerRepo}/zip/refs/${refType}/${version}`;