mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-23 03:45:50 -06:00
try atEnd?
This commit is contained in:
parent
acbe72fa2e
commit
5a954a92bf
1 changed files with 3 additions and 2 deletions
|
@ -45,11 +45,12 @@ proc runCmdCapt*(
|
||||||
errstrm = peekableErrorStream p
|
errstrm = peekableErrorStream p
|
||||||
result.exitCode = -1
|
result.exitCode = -1
|
||||||
var line: string
|
var line: string
|
||||||
|
# BUG: the readLine's hang if there is no data. would peek also hang?
|
||||||
while true:
|
while true:
|
||||||
if CaptStdout in capture and not isNil(outstrm):
|
if CaptStdout in capture and not outstrm.atEnd():
|
||||||
if outstrm.readLine(line):
|
if outstrm.readLine(line):
|
||||||
result.stdout.add line & '\n'
|
result.stdout.add line & '\n'
|
||||||
if CaptStderr in capture and not isNil(errstrm):
|
if CaptStderr in capture and not errstrm.atEnd():
|
||||||
if errstrm.readLine(line):
|
if errstrm.readLine(line):
|
||||||
result.stderr.add line & '\n'
|
result.stderr.add line & '\n'
|
||||||
result.exitCode = peekExitCode(p)
|
result.exitCode = peekExitCode(p)
|
||||||
|
|
Loading…
Add table
Reference in a new issue