From 0c2423043d2ba9979dca951a61473925edd2def6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 12 Oct 2025 01:07:00 -0500 Subject: Exit() callback works --- doShow.go | 13 +++++++++++++ exit.go | 4 +--- main.go | 35 ++++------------------------------- 3 files changed, 18 insertions(+), 34 deletions(-) diff --git a/doShow.go b/doShow.go index 5f4025f..1b11f2e 100644 --- a/doShow.go +++ b/doShow.go @@ -49,3 +49,16 @@ func doShow() (string, error) { } return footer, nil } + +func showUrls() bool { + if argv.Show == nil { + return false + } + if argv.Show.Repo == nil { + return false + } + if argv.Show.Repo.Urls != nil { + return true + } + return false +} diff --git a/exit.go b/exit.go index b46a5a8..e0096e2 100644 --- a/exit.go +++ b/exit.go @@ -17,9 +17,7 @@ func forgeShutdown() { gui.UnloadToolkits() resetTerminalTitle() log.Info("exit got to forgeShutdown()") - if configSave { - me.forge.SetConfigSave(configSave) - } + // me.forge.SetConfigSave(configSave) if err := me.forge.Close(); err != nil { log.Info("ABNORMAL END", err) } diff --git a/main.go b/main.go index a180acb..8fd3602 100644 --- a/main.go +++ b/main.go @@ -7,19 +7,16 @@ package main import ( "embed" - "strings" "go.wit.com/lib/gui/prep" "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/lib/protobuf/gitpb" - "go.wit.com/log" ) -// sent via -ldflags +// sent via -ldflags // is there a better way? var VERSION string var BUILDTIME string -// this optionally can store the GUI plugins +// at build time, this can be used to store GUI plugins with matching GO deps // //go:embed resources/* var resources embed.FS @@ -27,31 +24,6 @@ var resources embed.FS // used for shell auto completion var ARGNAME string = "forge" -// using this for now. triggers config save -var configSave bool - -func getVersion(repo *gitpb.Repo, name string) string { - cmd := []string{"git", "describe", "--tags", "--always", name} - result, _ := repo.RunQuiet(cmd) - output := strings.Join(result.Stdout, "\n") - log.Info("cmd =", cmd, output) - - return strings.TrimSpace(output) -} - -func showUrls() bool { - if argv.Show == nil { - return false - } - if argv.Show.Repo == nil { - return false - } - if argv.Show.Repo.Urls != nil { - return true - } - return false -} - func main() { me = new(mainType) @@ -84,7 +56,6 @@ func main() { } //// start standard argv subcommand processing here //// - var s string var err error if argv.Dev != nil { @@ -147,7 +118,9 @@ func main() { if argv.Patch != nil { s, err = doPatch() } + //// end standard argv subcommand processing here //// + // if the gui starts, it doesn't yet go to the end normally if argv.Gui != nil { me.myGui.Start() // loads the GUI toolkit doGui() // start making our forge GUI -- cgit v1.2.3