From 68e5c9be2dd9d689da517a925bdcda1b11f2bb78 Mon Sep 17 00:00:00 2001 From: Fabian Schlenz Date: Thu, 8 Mar 2018 22:13:30 +0100 Subject: [PATCH] If a new version is available, the message will be displayed a bit more prominent and with a 5 second delay. --- .../telegram_backup/CommandLineRunner.kt | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/kotlin/de/fabianonline/telegram_backup/CommandLineRunner.kt b/src/main/kotlin/de/fabianonline/telegram_backup/CommandLineRunner.kt index b8d6801..a922902 100644 --- a/src/main/kotlin/de/fabianonline/telegram_backup/CommandLineRunner.kt +++ b/src/main/kotlin/de/fabianonline/telegram_backup/CommandLineRunner.kt @@ -19,6 +19,7 @@ package de.fabianonline.telegram_backup import de.fabianonline.telegram_backup.CommandLineController import de.fabianonline.telegram_backup.Utils import de.fabianonline.telegram_backup.Version +import java.util.concurrent.TimeUnit import org.slf4j.LoggerFactory import ch.qos.logback.classic.Logger import ch.qos.logback.classic.LoggerContext @@ -78,14 +79,21 @@ object CommandLineRunner { fun checkVersion(): Boolean { val v = Utils.getNewestVersion() if (v != null && v.isNewer) { - System.out.println("A newer version is vailable!") - System.out.println("You are using: " + Config.APP_APPVER) - System.out.println("Available: " + v.version) - System.out.println("Get it here: " + v.url) - System.out.println() - System.out.println("Changes in this version:") - System.out.println(v.body) - System.out.println() + println() + println() + println() + println("A newer version is vailable!") + println("You are using: " + Config.APP_APPVER) + println("Available: " + v.version) + println("Get it here: " + v.url) + println() + println() + println("Changes in this version:") + println(v.body) + println() + println() + println() + TimeUnit.SECONDS.sleep(5) return false } return true