fix processenvironment

master
Josha von Gizycki 3 weeks ago
parent fb0cdb12ae
commit 13e24e923f

@ -19,11 +19,14 @@ class ProcessEnvironment {
useEnv: MutableMap<String, String> = System.getenv() useEnv: MutableMap<String, String> = System.getenv()
) = ) =
useEnv.let { env -> useEnv.let { env ->
env.filter { it.key.contains("ALFRED") }.forEach { env.remove(it.key) } val newEnv = mutableMapOf<String, String>()
env.putAll(config.env) newEnv.putAll(env)
env["ALFRED_LOG_FILE"] = logFile.backingFile.absolutePath
env["ALFRED_REV"] = rev ?: "" newEnv.filter { it.key.contains("ALFRED") }.forEach { env.remove(it.key) }
env newEnv.putAll(config.env)
newEnv["ALFRED_LOG_FILE"] = logFile.backingFile.absolutePath
newEnv["ALFRED_REV"] = rev ?: ""
newEnv
} }
} }

@ -2,7 +2,6 @@ package alfred.web.system
import alfred.web.core.build.BuildConfig import alfred.web.core.build.BuildConfig
import alfred.web.core.build.LogFile import alfred.web.core.build.LogFile
import alfred.web.system.ProcessEnvironment
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
import java.nio.file.Files import java.nio.file.Files
import kotlin.test.assertEquals import kotlin.test.assertEquals

Loading…
Cancel
Save