mirror of
https://github.com/tachiyomiorg/tachiyomi-extensions-inspector.git
synced 2024-12-25 00:01:49 +01:00
Allow rootdir to be used as a argument
This commit is contained in:
parent
e043cb5690
commit
c11887fada
@ -43,15 +43,16 @@ val systemTray by lazy { systemTray() }
|
|||||||
|
|
||||||
val androidCompat by lazy { AndroidCompat() }
|
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) {
|
val dirs = if (rootDir != null) {
|
||||||
ApplicationDirs(rootDir)
|
ApplicationDirs(rootDir)
|
||||||
} else {
|
} else {
|
||||||
ApplicationDirs()
|
ApplicationDirs().also {
|
||||||
|
System.setProperty("ir.armor.tachidesk.rootDir", it.dataRoot)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
System.setProperty("ir.armor.tachidesk.rootDir", dirs.dataRoot)
|
|
||||||
|
|
||||||
// make dirs we need
|
// make dirs we need
|
||||||
listOf(
|
listOf(
|
||||||
dirs.dataRoot,
|
dirs.dataRoot,
|
||||||
|
@ -41,7 +41,8 @@ class TestExtensions {
|
|||||||
@BeforeAll
|
@BeforeAll
|
||||||
fun setup() {
|
fun setup() {
|
||||||
val dataRoot = File("tmp/TestDesk").absolutePath
|
val dataRoot = File("tmp/TestDesk").absolutePath
|
||||||
applicationSetup(dataRoot)
|
System.setProperty("ir.armor.tachidesk.rootDir", dataRoot)
|
||||||
|
applicationSetup()
|
||||||
setLoggingEnabled(false)
|
setLoggingEnabled(false)
|
||||||
runBlocking {
|
runBlocking {
|
||||||
extensions = getExtensionList()
|
extensions = getExtensionList()
|
||||||
|
Loading…
Reference in New Issue
Block a user