mirror of
https://github.com/daylinmorgan/oizys.git
synced 2025-02-02 15:04:18 -06:00
fix stdout/stderr formatting
This commit is contained in:
parent
a259bbc8a7
commit
74a6a2e25c
1 changed files with 10 additions and 15 deletions
|
@ -57,21 +57,16 @@ proc runCmdCapt*(
|
|||
close p
|
||||
|
||||
proc formatStdoutStderr(stdout: string, stderr: string): string =
|
||||
template 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"
|
||||
|
||||
result.add "stdout:\n"
|
||||
for line in stdout.splitLines():
|
||||
addLine
|
||||
|
||||
result.add "stdout:\n"
|
||||
for line in stderr.splitLines():
|
||||
addLine
|
||||
|
||||
|
||||
show(stdout)
|
||||
show(stderr)
|
||||
|
||||
proc runCmdCaptWithSpinner*(
|
||||
cmd: string,
|
||||
|
|
Loading…
Reference in a new issue