Skip to content
This repository has been archived by the owner on Dec 7, 2019. It is now read-only.

Run command as is in Windows even with unbuffered mode. #14

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

yunikkk
Copy link
Contributor

@yunikkk yunikkk commented Feb 25, 2018

Continuation of #4 .

@@ -50,15 +50,15 @@ fun process(

val command: List<String>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like it is possible to make it like this:

val command: List<String> = if (unbufferedOutput) {
    commandAndArgs
} else {
    when (os()) {
        Linux -> listOf()
        Mac -> listOf()
        Windows -> commandAndArgs
    }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh, sure

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation went off a bit.

@yunikkk yunikkk force-pushed the dont-buffer-on-windows branch from 7d9a577 to d6b1b5c Compare February 25, 2018 17:48
@artem-zinnatullin
Copy link
Contributor

👍

@artem-zinnatullin
Copy link
Contributor

@yunikkk your git config is broken as usual lol, fix email!

@yunikkk
Copy link
Contributor Author

yunikkk commented Feb 27, 2018

@artem-zinnatullin damn it=\

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants