Marko Kunic
01/11/2022, 4:58 PM.env
variables into ktor before starting local env or running tests?Big Chungus
01/11/2022, 5:06 PMTodd
01/11/2022, 6:43 PMgradlew run
val run by tasks.getting(JavaExec::class) {
file(".env").readLines().forEach {
if (it.isNotEmpty() && !it.startsWith("#")) {
val equalsPos = it.indexOf("=")
val key = it.substring(0, equalsPos)
val value = it.substring(equalsPos + 1)
if (System.getenv(key) == null) {
environment[key] = value
}
}
}
}
Doesn’t handle all of the cases, but can probably do what you needNicolas Picon
01/12/2022, 2:27 PMAleksei Tirman [JB]
01/13/2022, 2:39 PM