From 41b716d64489638e14cead1b397153c69fd3539d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 15 Dec 2024 08:47:03 -0600 Subject: still testing when in 'go.work' mode --- go-clone-test/main.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'go-clone-test/main.go') diff --git a/go-clone-test/main.go b/go-clone-test/main.go index 46c296b..cb49a69 100644 --- a/go-clone-test/main.go +++ b/go-clone-test/main.go @@ -20,6 +20,7 @@ func main() { me = new(testMe) me.startPwd, _ = os.Getwd() + // don't run this anywhere important me.forge = forgepb.Init() if me.forge.IsGoWork() { log.Info() @@ -39,6 +40,9 @@ func main() { } } + // make sure this is empty + me.forge = nil + me.testDir1 = "goclonetest" fullRun(me.testDir1) @@ -101,8 +105,8 @@ func prepBinary(testDir string, gopath string) { os.Unsetenv("FORGE_CONFIG") os.Unsetenv("FORGE_GOSRC") runStrict(wd, []string{"sync"}) - runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--recursive", gopath}) - runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--work"}) + runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--recursive", gopath, "--work"}) + // runStrict(wd, []string{"/home/jcarr/go/bin/go-clone", "--work"}) } func buildBinary(testDir string, gopath string) { @@ -142,24 +146,20 @@ func runStrict(wd string, cmd []string) { log.Info(wd, "running:", wd, cmd) // result := shell.Run(cmd) result := shell.RunRealtime(cmd) - if result.Exit != 0 { + if result.Error != nil { log.Info("cmd failed", wd, cmd, err) - for i, line := range result.Stdout { - log.Info("STDOUT:", i, line) - } - for i, line := range result.Stderr { - log.Info("STDERR:", i, line) - } + /* + for i, line := range result.Stdout { + log.Info("STDOUT:", i, line) + } + for i, line := range result.Stderr { + log.Info("STDERR:", i, line) + } + */ os.Exit(-1) } - if result.Error != nil { - log.Info("cmd failed", wd, cmd, err) - for i, line := range result.Stdout { - log.Info("STDOUT:", i, line) - } - for i, line := range result.Stderr { - log.Info("STDERR:", i, line) - } + if result.Exit != 0 { + log.Info("cmd failed", wd, cmd) os.Exit(-1) } for i, line := range result.Stdout { -- cgit v1.2.3