lenient Docker Env properties

This commit is contained in:
Adam 2022-12-05 23:20:54 +01:00
parent deefafe255
commit dd9c9500d3
2 changed files with 7 additions and 3 deletions

View file

@ -25,6 +25,7 @@ abstract class DockerEnvUpdateTask @Inject constructor(
) : DefaultTask() {
@get:Input
@get:Optional
abstract val envProperties: MapProperty<String, String>
@get:Input
@ -50,10 +51,11 @@ abstract class DockerEnvUpdateTask @Inject constructor(
val comment: String = comment.orNull
?: " Do not edit manually. This file was created with task '$name'"
val envProperties = envProperties.getOrElse(emptyMap())
dotEnvFile.writer(charset).use { writer ->
val properties = Properties()
properties.putAll(envProperties.get())
properties.putAll(envProperties)
properties.store(writer, comment)
}