1
0
Fork 0
mirror of https://github.com/ethauvin/kobalt.git synced 2025-04-26 08:27:12 -07:00

Refactor.

This commit is contained in:
Cedric Beust 2017-04-19 11:14:34 -07:00
parent abc9002292
commit 5bcb8185b8

View file

@ -105,10 +105,10 @@ open class NewRunCommand(val info: RunCommandInfo) {
open protected fun isSuccess(isSuccess: Boolean, input: List<String>, error: List<String>) : Boolean { open protected fun isSuccess(isSuccess: Boolean, input: List<String>, error: List<String>) : Boolean {
var hasErrors = ! isSuccess var hasErrors = ! isSuccess
if (info.useErrorStreamAsErrorIndicator && ! hasErrors) { if (info.useErrorStreamAsErrorIndicator && ! hasErrors) {
hasErrors = hasErrors || error.size > 0 hasErrors = hasErrors || error.isNotEmpty()
} }
if (info.useInputStreamAsErrorIndicator && ! hasErrors) { if (info.useInputStreamAsErrorIndicator && ! hasErrors) {
hasErrors = hasErrors || input.size > 0 hasErrors = hasErrors || input.isNotEmpty()
} }
return ! hasErrors return ! hasErrors