Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When 'shelling out' to an async operation,
FileHandler.standardOutput
can be passed in to see the output in realtime, in the same way as if the command had been executed in the Terminal:try shellOut(to: "pod repo update", outputHandle: FileHandle.standardOutput)
ShellOut currently calls
closeFile()
on the passed in output handler and error handler. In the case that one of the 'standard' handlers has been passed in, this causes issues such asprint()
not working.This PR checks for the 3 standard handlers (input, output, error) and bypasses the call to
closeFile()
. Any other passed inFileHandler
will receive the call.@JohnSundell let me know how you feel about this solution. It does add a special casing for the 3 handlers (which is a bit weird), but the advantage is that there's no additional complexity to the api, which is probably a good thing for a scripting library!