From 41b716d64489638e14cead1b397153c69fd3539d Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 15 Dec 2024 08:47:03 -0600 Subject: [PATCH] still testing when in 'go.work' mode --- go-clone-test/Makefile | 2 +- go-clone-test/main.go | 36 ++++++++++++++++++------------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/go-clone-test/Makefile b/go-clone-test/Makefile index 181acea..1e8c9f8 100644 --- a/go-clone-test/Makefile +++ b/go-clone-test/Makefile @@ -1,6 +1,6 @@ VERSION = $(shell git describe --tags) GUIVERSION = $(shell git describe --tags) -BUILDTIME = $(shell date +%Y.%m.%d_%H%M) +BUILDTIME = $(shell date +%s) all: build 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 { - 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) - } - 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) - } + /* + 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.Exit != 0 { + log.Info("cmd failed", wd, cmd) os.Exit(-1) } for i, line := range result.Stdout {