fix download url

This commit is contained in:
Jeffrey Morgan
2023-07-07 16:07:10 -04:00
parent 049295d9ba
commit 39e946f256
11 changed files with 101 additions and 23 deletions

20
web/app/download/page.tsx Normal file
View File

@@ -0,0 +1,20 @@
import { Octokit } from '@octokit/rest'
import { redirect } from 'next/navigation'
const octokit = new Octokit()
export default async function Download() {
const { data } = await octokit.repos.getLatestRelease({
owner: 'jmorganca',
repo: 'ollama',
})
// todo: get the correct asset for the current arch/os
const asset = data.assets.find(a => a.name.toLowerCase().includes('darwin') && a.name.toLowerCase().includes('.zip'))
if (asset) {
redirect(asset.browser_download_url)
}
return null
}