Skip to content

Commit

Permalink
Merge pull request #49 from jaypipes/exec-debug
Browse files Browse the repository at this point in the history
trim space from exec plugin out/err
  • Loading branch information
jaypipes authored Jul 8, 2024
2 parents abdb914 + 0d3fecd commit 64ace5b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugin/exec/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"bytes"
"context"
"os/exec"
"strings"

"github.com/gdt-dev/gdt/api"
gdtcontext "github.com/gdt-dev/gdt/context"
Expand Down Expand Up @@ -79,15 +80,21 @@ func (a *Action) Do(
debug.Println(ctx, "exec: error reading from stdout: %s", err)
}
if outbuf.Len() > 0 {
debug.Println(ctx, "exec: stdout: %s", outbuf.String())
debug.Println(
ctx, "exec: stdout: %s",
strings.TrimSpace(outbuf.String()),
)
}
}
if errbuf != nil {
if _, err = errbuf.ReadFrom(errpipe); err != nil {
debug.Println(ctx, "exec: error reading from stderr: %s", err)
}
if errbuf.Len() > 0 {
debug.Println(ctx, "exec: stderr: %s", errbuf.String())
debug.Println(
ctx, "exec: stderr: %s",
strings.TrimSpace(errbuf.String()),
)
}
}

Expand Down

0 comments on commit 64ace5b

Please sign in to comment.