diff --git a/os/src/main/kotlin/com/gojuno/commander/os/Processes.kt b/os/src/main/kotlin/com/gojuno/commander/os/Processes.kt index 324b77a..cb75795 100644 --- a/os/src/main/kotlin/com/gojuno/commander/os/Processes.kt +++ b/os/src/main/kotlin/com/gojuno/commander/os/Processes.kt @@ -50,15 +50,15 @@ fun process( val command: List - when (unbufferedOutput) { - false -> command = commandAndArgs - true -> command = when (os()) { + command = when (unbufferedOutput) { + false -> commandAndArgs + true -> when (os()) { // Some programs, in particular "emulator" do not always flush output // after printing so we have to force unbuffered mode to make sure // that output will be available for consuming. Linux -> listOf("script", outputFile.absolutePath, "--flush", "-c", commandAndArgs.joinToString(separator = " ")) Mac -> listOf("script", "-F", outputFile.absolutePath, *commandAndArgs.toTypedArray()) - Windows -> throw IllegalStateException("Unbuffered output is not supported on Windows") + Windows -> commandAndArgs } }