package main // An app to submit patches for the 30 GO GUI repos import ( "os" "go.wit.com/dev/alexflint/arg" "go.wit.com/lib/gadgets" "go.wit.com/lib/protobuf/forgepb" "go.wit.com/log" "go.wit.com/gui" ) // sent via -ldflags var VERSION string var BUILDTIME string func main() { me = new(mainType) me.pp = arg.MustParse(&argv) // load the ~/.config/forge/ config me.forge = forgepb.Init() os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc()) // show your forge config settings if argv.ListConf { me.forge.ConfigPrintTable() os.Exit(0) } // processes any --list like options // may exit list() scan() if argv.RedoGoMod { me.forge.RillRedoGoMod() os.Exit(0) repos := me.forge.Repos.SortByGoPath() for repos.Scan() { repo := repos.Next() if !repo.IsValid() { log.Printf("%10s %-50s", "old?", repo.GetGoPath()) continue } log.Printf("running on: %-50s", repo.GetGoPath()) if argv.Erase { repo.EraseGoMod() } else { repo.RedoGoMod() } } } me.pp.WriteHelp(os.Stdout) os.Exit(0) me.myGui = gui.New() me.myGui.Default() me.mainWindow = gadgets.RawBasicWindow("submit & test patchsets") me.mainWindow.Make() me.mainWindow.Show() me.mainbox = me.mainWindow.Box() // disable the interface while everything is scanned me.Disable() vbox2 := me.mainbox.NewVerticalBox("BOX2") globalBuildOptions(vbox2) me.summary = submitPatchesBox(vbox2) me.repos = makeRepoView() // processing is done. update the repo summary box me.summary.Update() me.Enable() // intermittently scans the status indefinitly me.repos.View.Watchdog(func() { log.Info("In main()") // processing is done. update the repo summary box me.summary.Update() }) }