Skip to content

Commit 69fd5fe

Browse files
authored
Merge pull request JohnSundell#42 from helje5/bugfixes/capture-data-early
Capture available data early
2 parents d3d54ce + c462c71 commit 69fd5fe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/ShellOut.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,16 @@ private extension Process {
367367

368368
#if !os(Linux)
369369
outputPipe.fileHandleForReading.readabilityHandler = { handler in
370+
let data = handler.availableData
370371
outputQueue.async {
371-
let data = handler.availableData
372372
outputData.append(data)
373373
outputHandle?.write(data)
374374
}
375375
}
376376

377377
errorPipe.fileHandleForReading.readabilityHandler = { handler in
378+
let data = handler.availableData
378379
outputQueue.async {
379-
let data = handler.availableData
380380
errorData.append(data)
381381
errorHandle?.write(data)
382382
}

0 commit comments

Comments
 (0)