try closing it?

This commit is contained in:
Daylin Morgan 2024-09-05 09:57:21 -05:00
parent af89a69eff
commit 2614aeb181
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -18,11 +18,16 @@ proc runCmd*(cmd: string): int =
proc runCmdCapt*(cmd: string): tuple[stdout, stderr: string, exitCode: int] = proc runCmdCapt*(cmd: string): tuple[stdout, stderr: string, exitCode: int] =
let args = cmd.splitWhitespace() let args = cmd.splitWhitespace()
let p = startProcess(args[0], args = args[1..^1], options = {poUsePath}) let p = startProcess(
args[0],
args = args[1..^1],
options = {poUsePath}
)
p.inputStream.close()
let ostrm = outputStream p let ostrm = outputStream p
let errstrm = errorStream p let errstrm = errorStream p
result.exitCode = -1 result.exitCode = -1
var line = newStringOfCap(120) var line: string
while true: while true:
if ostrm.readLine(line): if ostrm.readLine(line):
result.stdout.add line & '\n' result.stdout.add line & '\n'