fix stdout/stderr formatting

This commit is contained in:
Daylin Morgan 2025-01-23 11:41:29 -06:00
parent a259bbc8a7
commit 74a6a2e25c
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -57,21 +57,16 @@ proc runCmdCapt*(
close p
proc formatStdoutStderr(stdout: string, stderr: string): string =
template addLine =
# TODO: make -> red after hwylterm update
result.add "-> "
result.add line
result.add "\n"
result.add "stdout:\n"
for line in stdout.splitLines():
addLine
result.add "stdout:\n"
for line in stderr.splitLines():
addLine
template show(stream: string) =
if stream.strip() != "":
result.add astToStr(stream) & ":\n"
for line in stream.splitlines():
# TODO: make -> red after hwylterm update
result.add "-> "
result.add line
result.add "\n"
show(stdout)
show(stderr)
proc runCmdCaptWithSpinner*(
cmd: string,