From b05b706d8b48a51275a8dc0c90cd8fafc74d61d1 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 11 Sep 2025 14:21:09 -0500 Subject: raw gitpb Repo() scan --- main.go | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index f6e358c..4045b80 100644 --- a/main.go +++ b/main.go @@ -7,9 +7,8 @@ import ( "time" "go.wit.com/dev/alexflint/arg" - "go.wit.com/lib/fhelp" "go.wit.com/lib/gui/prep" - "go.wit.com/lib/protobuf/forgepb" + "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) @@ -29,37 +28,23 @@ func main() { me.myGui = prep.Gui() // prepares the GUI package for go-args me.pp = arg.MustParse(&argv) - if err := fhelp.ConfigureENV(); err != nil { + wd, err := os.Getwd() + if err != nil { badExit(err) } - me.goSrc = os.Getenv("FORGE_GOSRC") - if os.Getenv("FORGE_GOWORK") == "true" { - me.hasWork = true - } - log.Info("GO src path", me.goSrc, "go.work is", me.hasWork) - - // set the go src path - os.Setenv("REPO_WORK_PATH", me.goSrc) - - if argv.Forge != "" { - me.forge = forgepb.Init() - - me.repo = me.forge.Repos.FindByFullPath(argv.Forge) - if me.repo == nil { - log.Info("repo not found", argv.Forge) - me.repo = me.forge.FindByGoPath(argv.Forge) - } - if me.repo == nil { - log.Info("forge failure. repo not found", argv.Forge) - os.Exit(-1) - } - log.Info("found repo", me.repo.GetGoPath()) + + me.repo, err = gitpb.NewRepo(wd) + if err != nil { + badExit(err) } + // build() if argv.Show != nil { log.Info("todo: show", me.repo.GetGoPath()) okExit("") } + log.Info("todo: show", me.repo.GetNamespace(), me.repo.GetFullPath()) + okExit("") me.basicWindow = makebasicWindow() -- cgit v1.2.3