1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Don't display an update is available if it's been downloaded.

This commit is contained in:
Cedric Beust 2015-12-16 20:57:28 +04:00
parent d74a68e31f
commit 8335a3c06b

View file

@ -116,10 +116,15 @@ private class Main @Inject constructor(
val latestVersionString = latestVersionFuture.get(1, TimeUnit.SECONDS)
val latestVersion = Versions.toLongVersion(latestVersionString)
val current = Versions.toLongVersion(Kobalt.version)
val distFile = File(KFiles.joinDir(KFiles.distributionsDir, latestVersionString))
if (latestVersion > current) {
listOf("", "New Kobalt version available: $latestVersionString",
"To update, run ./kobaltw --update", "").forEach {
log(1, "**** $it")
if (distFile.exists()) {
log(1, "**** Version $latestVersionString is installed")
} else {
listOf("", "New Kobalt version available: $latestVersionString",
"To update, run ./kobaltw --update", "").forEach {
log(1, "**** $it")
}
}
}
} catch(ex: TimeoutException) {