Allow rootdir to be used as a argument

This commit is contained in:
Syer10 2021-04-03 18:35:30 -04:00
parent e043cb5690
commit c11887fada
2 changed files with 7 additions and 5 deletions

View File

@ -43,15 +43,16 @@ val systemTray by lazy { systemTray() }
val androidCompat by lazy { AndroidCompat() }
fun applicationSetup(rootDir: String? = null) {
fun applicationSetup() {
val rootDir: String? = System.getProperty("ir.armor.tachidesk.rootDir")
val dirs = if (rootDir != null) {
ApplicationDirs(rootDir)
} else {
ApplicationDirs()
ApplicationDirs().also {
System.setProperty("ir.armor.tachidesk.rootDir", it.dataRoot)
}
}
System.setProperty("ir.armor.tachidesk.rootDir", dirs.dataRoot)
// make dirs we need
listOf(
dirs.dataRoot,

View File

@ -41,7 +41,8 @@ class TestExtensions {
@BeforeAll
fun setup() {
val dataRoot = File("tmp/TestDesk").absolutePath
applicationSetup(dataRoot)
System.setProperty("ir.armor.tachidesk.rootDir", dataRoot)
applicationSetup()
setLoggingEnabled(false)
runBlocking {
extensions = getExtensionList()