From debe6c92c815ca64de4f3502d52935436254f006 Mon Sep 17 00:00:00 2001 From: boxi Date: Fri, 3 Apr 2026 22:11:01 +0200 Subject: [PATCH] refactor rename to application.yaml --- src/main/kotlin/ch/ergon/anytask/config/Configuration.kt | 8 ++++---- src/main/resources/anytask.yaml | 3 --- 2 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 src/main/resources/anytask.yaml diff --git a/src/main/kotlin/ch/ergon/anytask/config/Configuration.kt b/src/main/kotlin/ch/ergon/anytask/config/Configuration.kt index e6d6c89..1761e0f 100644 --- a/src/main/kotlin/ch/ergon/anytask/config/Configuration.kt +++ b/src/main/kotlin/ch/ergon/anytask/config/Configuration.kt @@ -43,8 +43,8 @@ fun loadConfig(): ConfigResult { // External files take precedence (production use) val externalLocations = listOf( - File(System.getProperty("user.home"), ".anytask/anytask.yaml"), - File("anytask.yaml"), + File(System.getProperty("user.home"), ".anytask/application.yaml"), + File("application.yaml"), ) externalLocations.firstOrNull { it.exists() }?.let { file -> val config = yaml.decodeFromString(serializer, file.readText()) @@ -53,7 +53,7 @@ fun loadConfig(): ConfigResult { } // Fallback: classpath resource (development) - Configuration::class.java.getResourceAsStream("/anytask.yaml")?.let { stream -> + Configuration::class.java.getResourceAsStream("/application.yaml")?.let { stream -> val config = yaml.decodeFromString(serializer, stream.bufferedReader().readText()) logger.info("Loaded config from classpath:/anytask.yaml") return ConfigResult(config, null) @@ -64,7 +64,7 @@ fun loadConfig(): ConfigResult { } fun saveConfig(config: Configuration, sourceFile: File?) { - val file = sourceFile ?: File(System.getProperty("user.home"), ".anytask/anytask.yaml") + val file = sourceFile ?: File(System.getProperty("user.home"), ".anytask/application.yaml") file.parentFile?.mkdirs() val yaml = Yaml.default file.writeText(yaml.encodeToString(Configuration.serializer(), config)) diff --git a/src/main/resources/anytask.yaml b/src/main/resources/anytask.yaml deleted file mode 100644 index 1c81f3a..0000000 --- a/src/main/resources/anytask.yaml +++ /dev/null @@ -1,3 +0,0 @@ -connection: - apiKey: 2tkMSzFegWwzsQ+n9SpGwVjychEkCESWjV1/ftytXG4= -spaceId: bafyreiafzvfsrurvx4gvr2wwysgp5uugujzmbdg5hxnjlahfmx3ww6kxfy.172mmtcppmjtt