mirror of
https://github.com/ethauvin/kobalt.git
synced 2025-04-27 00:38:11 -07:00
Github API fix.
This commit is contained in:
parent
fd2c9a932f
commit
1a58b70a8e
1 changed files with 10 additions and 7 deletions
|
@ -117,14 +117,17 @@ class GithubApi2 @Inject constructor(
|
||||||
} else {
|
} else {
|
||||||
service.getReleasesNoAuth("cbeust", "kobalt")
|
service.getReleasesNoAuth("cbeust", "kobalt")
|
||||||
}
|
}
|
||||||
val releases = req.execute()
|
val releases = req.execute().body()
|
||||||
.body()
|
if (releases != null) {
|
||||||
releases.firstOrNull()?.let {
|
releases.firstOrNull()?.let {
|
||||||
try {
|
try {
|
||||||
result = listOf(it.name, it.tagName).filterNotNull().first { !it.isBlank() }
|
result = listOf(it.name, it.tagName).filterNotNull().first { !it.isBlank() }
|
||||||
} catch(ex: NoSuchElementException) {
|
} catch(ex: NoSuchElementException) {
|
||||||
throw KobaltException("Couldn't find the latest release")
|
throw KobaltException("Couldn't find the latest release")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
warn("Didn't receive any body in the response to GitHub.getReleases()")
|
||||||
}
|
}
|
||||||
} catch(e: Exception) {
|
} catch(e: Exception) {
|
||||||
log(1, "Couldn't retrieve releases from github: " + e.message)
|
log(1, "Couldn't retrieve releases from github: " + e.message)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue