Skip to content

Commit

Permalink
fix nightly download url
Browse files Browse the repository at this point in the history
  • Loading branch information
qimiko committed Jan 22, 2024
1 parent d1a4323 commit de6fad4
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app/src/main/java/com/geode/launcher/updater/ReleaseRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
private const val GITHUB_API_VERSION = "2022-11-28"
}

suspend fun getLatestLauncherRelease(): Release? {
val releasePath = "$GITHUB_API_BASE/repos/geode-sdk/android-launcher/releases/latest"

val url = URL(releasePath)

return getReleaseByUrl(url)
}

suspend fun getLatestGeodeRelease(isNightly: Boolean = false): Release? {
val releasePath = if (isNightly) "$GITHUB_API_BASE/releases/tags/nightly"
else "$GITHUB_API_BASE/repos/geode-sdk/geode/releases/latest"
val geodeBaseUrl = "$GITHUB_API_BASE/repos/geode-sdk/geode/releases"
val releasePath = if (isNightly) "$geodeBaseUrl/tags/nightly"
else "$geodeBaseUrl/latest"

val url = URL(releasePath)

Expand All @@ -34,6 +43,8 @@ class ReleaseRepository(private val httpClient: OkHttpClient) {
.addHeader(GITHUB_API_HEADER, GITHUB_API_VERSION)
.build()

println("fetching url $url")

val call = httpClient.newCall(request)
val response = call.executeCoroutine()

Expand Down

0 comments on commit de6fad4

Please sign in to comment.