mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-20 04:37:00 +00:00
fix download url
This commit is contained in:
20
web/app/download/page.tsx
Normal file
20
web/app/download/page.tsx
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user