Maybe this will work?

This commit is contained in:
Emma Manteater
2026-07-28 16:21:21 -04:00
parent 8bcb577923
commit a58732d090
+16 -2
View File
@@ -1,5 +1,19 @@
import { fetch } from 'undici'
import packageJSON from '../package.json' with { type: 'json' }
const latestRelease = await (await fetch('https://api.github.com/repos/MarmadileManteater/FreetubeAndroid/releases?per_page=1')).text()
console.log(latestRelease)
const latestRelease = JSON.parse(await (await fetch('https://api.github.com/repos/MarmadileManteater/FreetubeAndroid/releases?per_page=1')).text())
const code = latestRelease[0].name
const [_, latestMajor, latestMinor, latestBuild] = code.split('.')
const [__, major, minor] = packageJSON.version.split('.')
if (
latestMajor == major &&
latestMinor
) {
console.log(parseInt(latestBuild) + 1)
} else {
console.log(1)
}