Skip to content

Commit 64ace5b

Browse files
authored
Merge pull request #49 from jaypipes/exec-debug
trim space from exec plugin out/err
2 parents abdb914 + 0d3fecd commit 64ace5b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugin/exec/action.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"bytes"
99
"context"
1010
"os/exec"
11+
"strings"
1112

1213
"github.com/gdt-dev/gdt/api"
1314
gdtcontext "github.com/gdt-dev/gdt/context"
@@ -79,15 +80,21 @@ func (a *Action) Do(
7980
debug.Println(ctx, "exec: error reading from stdout: %s", err)
8081
}
8182
if outbuf.Len() > 0 {
82-
debug.Println(ctx, "exec: stdout: %s", outbuf.String())
83+
debug.Println(
84+
ctx, "exec: stdout: %s",
85+
strings.TrimSpace(outbuf.String()),
86+
)
8387
}
8488
}
8589
if errbuf != nil {
8690
if _, err = errbuf.ReadFrom(errpipe); err != nil {
8791
debug.Println(ctx, "exec: error reading from stderr: %s", err)
8892
}
8993
if errbuf.Len() > 0 {
90-
debug.Println(ctx, "exec: stderr: %s", errbuf.String())
94+
debug.Println(
95+
ctx, "exec: stderr: %s",
96+
strings.TrimSpace(errbuf.String()),
97+
)
9198
}
9299
}
93100

0 commit comments

Comments
 (0)