diff --git a/Makefile b/Makefile index 7ec09f9..524bf5c 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,7 @@ redomod: rm -f go.* GO111MODULE= go mod init GO111MODULE= go mod tidy + go mod edit -go=1.20 curl-help: curl --silent http://localhost:9419/help diff --git a/initRepoList.go b/initRepoList.go deleted file mode 100644 index 322ee5c..0000000 --- a/initRepoList.go +++ /dev/null @@ -1,27 +0,0 @@ -package main - -// this initializes the repos - -import ( - "strings" - - "go.wit.com/lib/gui/repostatus" - "go.wit.com/log" -) - -func (r *repoWindow) initRepoList() { - r.View.InitRepoList(".config/autotypist") - - if myargv.OnlyMe { - log.Info("not scanning everything") - } else { - log.Info("scanning everything in ~/go/src") - for i, path := range repostatus.ListGitDirectories() { - // log.Info("addRepo()", i, path) - path = strings.TrimPrefix(path, me.goSrcPwd.String()) - path = strings.Trim(path, "/") - log.Info("addRepo()", i, path) - r.View.NewRepo(path) - } - } -} diff --git a/main.go b/main.go index 30d7730..a6752a6 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,11 @@ package main import ( "embed" + "os" "go.wit.com/lib/debugger" + "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/gui/repolist" "go.wit.com/log" "go.wit.com/gui" @@ -18,7 +21,10 @@ var myargv argv func main() { me = new(autoType) - standardMachineInit() + // load the ~/.config/forge/ config + me.forge = forgepb.Init() + me.forge.ConfigPrintTable() + os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc()) log.DaemonMode(false) me.myGui = gui.New() @@ -50,8 +56,8 @@ func main() { me.repos = makeRepoView() - // parse config file and scan for .git repos - me.repos.initRepoList() + me.repos.View = repolist.Init(me.forge, me.myGui) + me.repos.View.Enable() // reads in the State of all the repos // TODO: should not really be necessary directly after init() diff --git a/nohup.out b/nohup.out deleted file mode 100644 index e69de29..0000000 diff --git a/repoview.go b/repoview.go index 22b9dde..88f5994 100644 --- a/repoview.go +++ b/repoview.go @@ -56,12 +56,14 @@ func makeRepoView() *repoWindow { r.topbox = r.repoMenu() - r.View = repolist.AutotypistView(r.box) + /* + r.View = repolist.AutotypistView(r.box) - showncount := r.View.MirrorShownCount() - r.topbox.Append(showncount) - duration := r.View.MirrorScanDuration() - r.topbox.Append(duration) + showncount := r.View.MirrorShownCount() + r.topbox.Append(showncount) + duration := r.View.MirrorScanDuration() + r.topbox.Append(duration) + */ return r } diff --git a/standardMachineInit.go b/standardMachineInit.go deleted file mode 100644 index 8a30b5c..0000000 --- a/standardMachineInit.go +++ /dev/null @@ -1,45 +0,0 @@ -package main - -import ( - "os" - - "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/log" -) - -// does a standard forgepb & zoopb init - -func standardMachineInit() { - var err error - me.forge.Init() - - me.forge.ConfigPrintTable() - - // load the ~/.config/forge/ machine file from zoopb - if err = me.machine.ConfigLoad(); err != nil { - log.Warn("zoopb.ConfigLoad() failed", err) - os.Exit(-1) - } - me.machine.InitWit() - - // list all packages from mirrors.wit.com - /* - loop := me.machine.Wit.SortByName() - for loop.Scan() { - p := loop.Package() - log.Info("package:", p.Name, p.Version, p.PkgName) - } - */ - - // use ~/go/src unless we find a go.work file in a parent directory - if me.goSrcPath, err = forgepb.FindGoSrc(); err != nil { - log.Info(err) - os.Exit(-1) - } - - // this ENV value is used by the repolist and repostatus packages - if me.goSrcPath != "" { - os.Setenv("REPO_WORK_PATH", me.goSrcPath) - - } -} diff --git a/structs.go b/structs.go index 1ff6527..2336180 100644 --- a/structs.go +++ b/structs.go @@ -4,7 +4,6 @@ import ( "go.wit.com/gui" "go.wit.com/lib/gadgets" "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/lib/protobuf/zoopb" ) var me *autoType @@ -20,14 +19,11 @@ func (b *autoType) Enable() { // this app's variables type autoType struct { // your customized repo preferences and settings - forge forgepb.Forge + forge *forgepb.Forge // where your ~/go/src is goSrcPath string - // use zookeeper to get the list of installed packages - machine zoopb.Machine - // allrepos map[string]*repo myGui *gui.Node