You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
provs/src/main/kotlin/org/domaindrivenarchitecture/provs/syspec/domain/SyspecService.kt

20 lines
684 B
Kotlin

package org.domaindrivenarchitecture.provs.syspec.domain
import org.domaindrivenarchitecture.provs.configuration.domain.ConfigFileName
import org.domaindrivenarchitecture.provs.framework.core.Prov
import org.domaindrivenarchitecture.provs.framework.core.ProvResult
import org.domaindrivenarchitecture.provs.syspec.infrastructure.findSpecConfigFromFile
import org.domaindrivenarchitecture.provs.syspec.infrastructure.verifySpecConfig
fun Prov.verifySpec(config: ConfigFileName?) = task {
val spec = findSpecConfigFromFile(config)
if (spec == null) {
ProvResult(false, "Could not read file: ${config?.fileName}")
} else {
verifySpecConfig(spec)
}
}