diff options
| author | forge <[email protected]> | 2025-10-06 12:17:14 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-06 12:18:25 -0500 |
| commit | 5b277e7686974d2195586d5f5b82838ee9ddb036 (patch) | |
| tree | defcb27118f58bec1889a13881f5e8ea7f3bc093 /main.go | |
| parent | 3d2fc4fe304ba53d3b576aaa4c8e6953565cdc11 (diff) | |
working on ping pong
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 27 |
1 files changed, 27 insertions, 0 deletions
@@ -2,12 +2,16 @@ package main import ( "embed" + "errors" "fmt" "net/http" + "os" + "path/filepath" "time" "go.wit.com/lib/gui/prep" "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -21,6 +25,14 @@ var resources embed.FS var HOSTNAME string = "forge.wit.com" +func saveMissing() error { + err := me.missing.Save(filepath.Join(me.forge.Config.ReposDir, "missing.pb")) + if err != nil { + log.Info("failed to save missing.pb", err) + } + return err +} + func main() { me = new(mainType) me.myGui = prep.Gui() // prepares the GUI package for go-args @@ -41,6 +53,21 @@ func main() { okExit("") } + me.missing = gitpb.NewRepos() + err := me.missing.ConfigLoad(filepath.Join(me.forge.Config.ReposDir, "missing.pb")) + if errors.Is(err, os.ErrNotExist) { + saveMissing() + } else if err != nil { + log.Info("loading missing.pb failed", err) + badExit(err) + } + + if argv.Missing != nil { + log.Info("loading missing.pb worked len =", me.missing.Len()) + me.missing.PrintMissingTable() + okExit("") + } + if argv.Repos != nil { if err := doRepos(); err != nil { badExit(err) |
