Skip to content

Commit

Permalink
fix: always get latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
richiemcilroy committed Mar 24, 2024
1 parent 085a8c4 commit 3c92878
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions apps/web/app/api/releases/tauri/[version]/[target]/[arch]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,10 @@ export async function GET(
}
) {
try {
let release;
if (params.version === "latest") {
const { data } = await octokit.repos.getLatestRelease({
owner: "capsoftware",
repo: "cap",
});
release = data;
} else {
const { data } = await octokit.repos.getReleaseByTag({
owner: "capsoftware",
repo: "cap",
tag: `cap-v${params.version}`,
});
release = data;
}
const { data: release } = await octokit.repos.getLatestRelease({
owner: "capsoftware",
repo: "cap",
});

const version = release.tag_name.replace("cap-v", "");
const notes = release.body;
Expand Down

0 comments on commit 3c92878

Please sign in to comment.