Fix Filehandler bugs & Swift 4 package comment. Groundwork for Async output#32
Fix Filehandler bugs & Swift 4 package comment. Groundwork for Async output#32iainsmith wants to merge 6 commits intoJohnSundell:masterfrom
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 <steve.barnegren@candyspace.com>
There was a problem hiding this comment.
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