1
0
mirror of https://github.com/fabianonline/telegram_backup.git synced 2024-11-22 16:56:16 +00:00

If a new version is available, the message will be displayed a bit more prominent and with a 5 second delay.

This commit is contained in:
Fabian Schlenz 2018-03-08 22:13:30 +01:00
parent 9a9e4284d9
commit 68e5c9be2d

View File

@ -19,6 +19,7 @@ package de.fabianonline.telegram_backup
import de.fabianonline.telegram_backup.CommandLineController import de.fabianonline.telegram_backup.CommandLineController
import de.fabianonline.telegram_backup.Utils import de.fabianonline.telegram_backup.Utils
import de.fabianonline.telegram_backup.Version import de.fabianonline.telegram_backup.Version
import java.util.concurrent.TimeUnit
import org.slf4j.LoggerFactory import org.slf4j.LoggerFactory
import ch.qos.logback.classic.Logger import ch.qos.logback.classic.Logger
import ch.qos.logback.classic.LoggerContext import ch.qos.logback.classic.LoggerContext
@ -78,14 +79,21 @@ object CommandLineRunner {
fun checkVersion(): Boolean { fun checkVersion(): Boolean {
val v = Utils.getNewestVersion() val v = Utils.getNewestVersion()
if (v != null && v.isNewer) { if (v != null && v.isNewer) {
System.out.println("A newer version is vailable!") println()
System.out.println("You are using: " + Config.APP_APPVER) println()
System.out.println("Available: " + v.version) println()
System.out.println("Get it here: " + v.url) println("A newer version is vailable!")
System.out.println() println("You are using: " + Config.APP_APPVER)
System.out.println("Changes in this version:") println("Available: " + v.version)
System.out.println(v.body) println("Get it here: " + v.url)
System.out.println() println()
println()
println("Changes in this version:")
println(v.body)
println()
println()
println()
TimeUnit.SECONDS.sleep(5)
return false return false
} }
return true return true