-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AsyncCommand use main.stdout / main.stderr #61
Comments
Yes that would be useful. But AsyncCommand.init is not public, so we need to change the public api. Do you think the use case is common enough to warrant a new function |
Usually one use case is enough to constantly bite you in the ass i always say 😄. |
I’m about to do some refactoring of Does anyone have a better idea for the name? It is a bit wordy, but I think it fits in nicely with run, runAsync and runAndPrint. Ideally this functionality should be implemented with an extra parameter on runAsync, but the return type needs to be different. |
@jakeheis I implemented runAsyncAndPrint in branch 61-AsyncCommand_use_main.stdout. |
will take pull. |
Just released version 4.1 with this feature. |
Right now,
AsyncCommand
will always change the process's stdout and stderr to aPipe
(https://github.com/kareman/SwiftShell/blob/master/Sources/SwiftShell/Command.swift#L291).There should be a way to start an
AsyncCommand
which still directs output tomain.stdout
andmain.stderr
. Simply forwarding the output using something like:is not sufficient, as pipes are block buffered but
main.stdout
is line buffered, so the command's output will not be written to stdout in the expected way.I think this could potentially be solved by changing
AsyncCommand.init
to something like:The text was updated successfully, but these errors were encountered: