-
Notifications
You must be signed in to change notification settings - Fork 87
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
Fix Filehandler bugs & Swift 4 package comment. Groundwork for Async output #32
Conversation
This adds two tests with no assertions to verify that standardOut & standardError are not closed. I tried wrapping the shellOut calls in XCTAssertNoThrow but this causes the tests to always pass. Co-authored-by: SteveBarnegren <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @iainsmith. I'm thinking if this is the right way to go API design wise 🤔 When I want async output it almost seems like a separate top level function should be used, something like:
shellOut(to: "command") { output in
...
}
I realize this would lead to some minor code duplication (or rather, that we have to maintain more top level functions). But I think it would lead to a much nicer to use API.
What do you think?
TL;DR. I’ve updated the PR to remove
So it seems like there are a few things to discuss here.
I’d like to propose we can move forward by:
We can always add StringHandle in a future PR if we want to. Here is an example of how I'm using the Handle protocol in [swift-docker] for streaming long running docker commands: (https://github.com/iainsmith/swift-docker/blob/7653086b109033cb47a63c175e90c1b7f80002f2/Sources/SwiftDockerLib/Logging.swift#L22L37) |
I also realised the original title of the PR wasn't that helpful 🤦♂️ |
Anything that needs to be done for this? :) |
Closing due to lack of feedback. |
👋 @JohnSundell.
This PR is a combination of work from @gwikiera & @SteveBarnegren (Added as a coauthor to the appropriate commit). If we merge this PR we can close #30 & #23.
Changes
Partially Reverted