From d7058576bdd605e08999ba886947e17c2d0a67a5 Mon Sep 17 00:00:00 2001 From: AH-dark Date: Sat, 9 Dec 2023 01:45:33 +0800 Subject: [PATCH] feat: allow to set config file path with `CONFIG_PATH` env --- build.gradle.kts | 2 +- src/main/kotlin/com/ahdark/code/utils/ConfigUtils.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0a0857b..b584e81 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,7 +19,7 @@ plugins { } group = "com.ahdark.code" -version = "1.0.3" +version = "1.0.4" application { mainClass.set("com.ahdark.code.ApplicationKt") diff --git a/src/main/kotlin/com/ahdark/code/utils/ConfigUtils.kt b/src/main/kotlin/com/ahdark/code/utils/ConfigUtils.kt index 442717b..12cf6db 100644 --- a/src/main/kotlin/com/ahdark/code/utils/ConfigUtils.kt +++ b/src/main/kotlin/com/ahdark/code/utils/ConfigUtils.kt @@ -5,7 +5,7 @@ import java.io.InputStream import java.util.* class ConfigUtils { - private val configFileName = "config.properties" + private val configFileName = System.getenv("CONFIG_PATH") ?: "config.properties" private val props = Properties() private val resourceStream: InputStream? = javaClass.classLoader.getResourceAsStream(configFileName)