Skip to content

Commit

Permalink
Merge pull request #42 from helje5/bugfixes/capture-data-early
Browse files Browse the repository at this point in the history
Capture available data early
  • Loading branch information
JohnSundell authored Dec 12, 2019
2 parents d3d54ce + c462c71 commit 69fd5fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/ShellOut.swift
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,16 @@ private extension Process {

#if !os(Linux)
outputPipe.fileHandleForReading.readabilityHandler = { handler in
let data = handler.availableData
outputQueue.async {
let data = handler.availableData
outputData.append(data)
outputHandle?.write(data)
}
}

errorPipe.fileHandleForReading.readabilityHandler = { handler in
let data = handler.availableData
outputQueue.async {
let data = handler.availableData
errorData.append(data)
errorHandle?.write(data)
}
Expand Down

0 comments on commit 69fd5fe

Please sign in to comment.