From 5d4ad13b7736b08ae8987dd31706c90f36a0118a Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 16 Jun 2019 11:59:40 -0700 Subject: track cmd failures Signed-off-by: Jeff Carr --- run.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'run.go') diff --git a/run.go b/run.go index 80ad18d..3e24793 100644 --- a/run.go +++ b/run.go @@ -8,7 +8,9 @@ import "io" import "fmt" import "os" import "bufio" + import "github.com/svent/go-nbreader" +// import "github.com/davecgh/go-spew/spew" import "log" // import "git.wit.com/wit/log" @@ -110,6 +112,7 @@ func (cmd *Shell) Exec(cmdline string) { // time.Sleep(2 * time.Second) // putting this here doesn't help STDOUT flush() if (err != nil) { + cmd.Fail = true cmd.Error = err log.Println("process.Wait() END err =", err.Error()) } else { @@ -118,6 +121,7 @@ func (cmd *Shell) Exec(cmdline string) { return } +// nonblocking read until file errors func (cmd *Shell) Capture(f *File) { // log.Debugln("nbrREADER() START") -- cgit v1.2.3