mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-13 09:26:11 -04:00
option to disable update checking
Add the command line flag `--disable_updater` to disable all checking for updates. Enabled for now, the gateway is still not yet implemented
This commit is contained in:
parent
c6978abe10
commit
4fb8960fd1
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
* Copyright (C) 2020-2024 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -111,6 +111,10 @@ object CommandLineArguments {
|
|||||||
addArgument("--render-api")
|
addArgument("--render-api")
|
||||||
.action(Arguments.store())
|
.action(Arguments.store())
|
||||||
.help("Render API to use. Defaults to gl")
|
.help("Render API to use. Defaults to gl")
|
||||||
|
|
||||||
|
addArgument("--disable-updater")
|
||||||
|
.action(Arguments.store())
|
||||||
|
.help("Force disables all update checking")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun parse(args: Array<String>) {
|
fun parse(args: Array<String>) {
|
||||||
@ -155,6 +159,8 @@ object CommandLineArguments {
|
|||||||
|
|
||||||
setWindowFactory(namespace.getString("window")?.lowercase() ?: "glfw")
|
setWindowFactory(namespace.getString("window")?.lowercase() ?: "glfw")
|
||||||
setRenderApi(namespace.getString("render_api")?.lowercase() ?: "gl")
|
setRenderApi(namespace.getString("render_api")?.lowercase() ?: "gl")
|
||||||
|
|
||||||
|
RunConfiguration.UPDATE_CHECKING = !namespace.getBoolean("disable_updater")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setWindowFactory(name: String) {
|
private fun setWindowFactory(name: String) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Minosoft
|
* Minosoft
|
||||||
* Copyright (C) 2020-2023 Moritz Zwerger
|
* Copyright (C) 2020-2024 Moritz Zwerger
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
@ -34,6 +34,9 @@ object RunConfiguration {
|
|||||||
|
|
||||||
var AUTO_CONNECT_TO: String? = null
|
var AUTO_CONNECT_TO: String? = null
|
||||||
|
|
||||||
|
|
||||||
|
var UPDATE_CHECKING = false // TODO: This should be enabled.
|
||||||
|
|
||||||
var HOME_DIRECTORY: Path = unsafeNull()
|
var HOME_DIRECTORY: Path = unsafeNull()
|
||||||
private set
|
private set
|
||||||
var CONFIG_DIRECTORY: Path = unsafeNull()
|
var CONFIG_DIRECTORY: Path = unsafeNull()
|
||||||
|
@ -20,6 +20,7 @@ import de.bixilon.kutil.string.StringUtil.formatPlaceholder
|
|||||||
import de.bixilon.kutil.url.URLUtil.toURL
|
import de.bixilon.kutil.url.URLUtil.toURL
|
||||||
import de.bixilon.minosoft.config.profile.profiles.other.OtherProfileManager
|
import de.bixilon.minosoft.config.profile.profiles.other.OtherProfileManager
|
||||||
import de.bixilon.minosoft.properties.MinosoftProperties
|
import de.bixilon.minosoft.properties.MinosoftProperties
|
||||||
|
import de.bixilon.minosoft.terminal.RunConfiguration
|
||||||
import de.bixilon.minosoft.util.http.HTTP2.get
|
import de.bixilon.minosoft.util.http.HTTP2.get
|
||||||
import de.bixilon.minosoft.util.http.HTTPResponse
|
import de.bixilon.minosoft.util.http.HTTPResponse
|
||||||
import de.bixilon.minosoft.util.http.exceptions.HTTPException
|
import de.bixilon.minosoft.util.http.exceptions.HTTPException
|
||||||
@ -44,6 +45,7 @@ object MinosoftUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun check(force: Boolean = false, callback: (MinosoftUpdate?) -> Unit) {
|
fun check(force: Boolean = false, callback: (MinosoftUpdate?) -> Unit) {
|
||||||
|
if (!RunConfiguration.UPDATE_CHECKING) return
|
||||||
if (!MinosoftProperties.canUpdate()) return
|
if (!MinosoftProperties.canUpdate()) return
|
||||||
if (!force) {
|
if (!force) {
|
||||||
this.update?.let { callback.invoke(update); return }
|
this.update?.let { callback.invoke(update); return }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user