Better way of setting it maybe?
This commit is contained in:
@@ -11,7 +11,6 @@ import com.typesafe.config.Config
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import com.typesafe.config.ConfigRenderOptions
|
||||
import mu.KotlinLogging
|
||||
import net.harawata.appdirs.AppDirsFactory
|
||||
import java.io.File
|
||||
|
||||
/**
|
||||
@@ -47,7 +46,7 @@ open class ConfigManager {
|
||||
|
||||
//Load user config
|
||||
val userConfig =
|
||||
File(System.getProperty("ir.armor.tachidesk.rootDir"), "server.conf").let {
|
||||
File(tachideskRootDir(), "server.conf").let {
|
||||
ConfigFactory.parseFile(it)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package xyz.nulldev.ts.config
|
||||
|
||||
import net.harawata.appdirs.AppDirsFactory
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
fun tachideskRootDir(): String {
|
||||
return System.getProperty(
|
||||
"ir.armor.tachidesk.rootDir",
|
||||
AppDirsFactory.getInstance().getUserDataDir("Tachidesk", null, null)
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user