From e2783ce0699b0867209a8a024e7aa1f3d187b76f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 16 Aug 2025 16:24:03 -0500 Subject: check plugins with Exec() --- init.go | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'init.go') diff --git a/init.go b/init.go index 1fabbb7..80d9d42 100644 --- a/init.go +++ b/init.go @@ -2,7 +2,6 @@ package gui import ( "errors" - "fmt" "os" "runtime/debug" @@ -38,7 +37,7 @@ func initNew() { me.guiChan = make(chan widget.Action, 1) version, err := getGuiVersion() - fmt.Println("GO GUI version", version, showVersion()+"", err) + log.Println("GO GUI version", version, showVersion()+"", err) if version == "" { log.Warn("Warning: compiled without version", err) log.Sleep(1) @@ -77,16 +76,16 @@ func getGuiVersion() (string, error) { if tmp == nil { return "", errors.New("compiled without go module support") } - // fmt.Println("mod.Path = ", tmp.Path) - // fmt.Println("mod.Main.Path = ", tmp.Main.Path) - // fmt.Println("mod.Main.Version = ", tmp.Main.Version) - // fmt.Println("mod.Main.Sum = ", tmp.Main.Sum) + // log.Println("mod.Path = ", tmp.Path) + // log.Println("mod.Main.Path = ", tmp.Main.Path) + // log.Println("mod.Main.Version = ", tmp.Main.Version) + // log.Println("mod.Main.Sum = ", tmp.Main.Sum) for _, value := range tmp.Deps { if value.Path == "go.wit.com/gui" { found = value.Version } - // fmt.Println("\tmod.Path = ", value.Path) - // fmt.Println("\tmod.Version = ", value.Version) + // log.Println("\tmod.Path = ", value.Path) + // log.Println("\tmod.Version = ", value.Version) } if found != "" { // log.Println("GUI build version:", found) @@ -282,7 +281,8 @@ func New() *Node { } */ if argGui.GuiTest != "" { - testPlugin() + // does os.Exec() and does not return + TestPluginAndExit() } initNew() @@ -296,6 +296,13 @@ func NoGui() bool { // try to load andlabs, if that doesn't work, fall back to the console func (n *Node) Default() *Node { var err error + // used to check if plugins load or not + if argGui.GuiCheck != "" { + // does os.Exec() and does not return + TestPluginAndExit() + os.Exit(0) + } + if argGui.NoGui { log.Log(WARN, "--no-gui chill Winston. I don't need no gui") return n @@ -415,12 +422,13 @@ func trapStdout() { origStderr = os.Stderr os.Stderr = guierrf + // maybe all this should be deleted now? println("TEST println") println("TEST println") println("TEST println") - fmt.Println("TEST fmt") - fmt.Println("TEST fmt") - fmt.Println("TEST fmt") + // maybe test fmt? or, maybe all this should be deleted now? + // fmt.Println("TEST fmt") + // fmt.Println("TEST fmt") log.Info("TEST log") log.Info("TEST log") log.Info("TEST log") -- cgit v1.2.3