diff --git a/Makefile b/Makefile index 0ec994e..64881b9 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,7 @@ vet: build: echo "build it!" -rm resources/*.so + -mkdir resources/ cp -a ~/go/src/go.wit.com/toolkits/*.so resources/ GO111MODULE=off go build \ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" @@ -34,6 +35,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/doRelease.go b/doRelease.go index e9eef6a..c3affc2 100644 --- a/doRelease.go +++ b/doRelease.go @@ -34,6 +34,7 @@ func doRelease() bool { log.Info("go.mod disappeared. need to run go mod init and go mod tidy here:", pwd) shell.RunRealtime([]string{"go", "mod", "init"}) shell.RunRealtime([]string{"go", "mod", "tidy"}) + shell.RunRealtime([]string{"go", "mod", "edit", "-go=1.20"}) } curName := me.current.Status.GetCurrentBranchName() @@ -189,7 +190,7 @@ func doPublishVersion() bool { log.Info("go get must be run from somewhere else other than guireleaser") log.Info("chdir to autotypist if it exists") if shell.Exists("/home/jcarr/go/src/go.wit.com/apps/autotypist") { - os.Chdir("/home/jcarr/go/src/go.wit.com/apps/autotypist") + os.Chdir("/home/jcarr/go/src/go.wit.com/apps/autotypist") } else { log.Info("need to chdir somewhere with go.sum & go.mod") return false diff --git a/initRepoList.go b/initRepoList.go deleted file mode 100644 index be01f1a..0000000 --- a/initRepoList.go +++ /dev/null @@ -1,35 +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/guireleaser") - - 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) - } -} - -func (r *repoWindow) tmpRepoList() { - - 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 ff0e7a8..3610038 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "go.wit.com/gui" "go.wit.com/lib/gui/gowit" "go.wit.com/lib/gui/shell" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/log" ) @@ -23,16 +24,9 @@ func main() { me = new(autoType) // load the ~/.config/forge/ config - if err := me.forge.ConfigLoad(); err != nil { - log.Warn("forgepb.ConfigLoad() failed", err) - os.Exit(-1) - } - - // 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.forge = forgepb.Init() + me.forge.ConfigPrintTable() + os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc()) // parse the command line arg.MustParse(&myargs) @@ -111,10 +105,6 @@ func main() { me.release.box.Disable() me.Disable() - // parse config file and scan for .git repos - me.repos.initRepoList() - // setTargetVersion() - // register a Show/Hide function for the repo list table me.repos.View.RegisterHideFunction(hideFunction) @@ -122,7 +112,6 @@ func main() { // TODO: should not really be necessary directly after init() me.repos.View.ScanRepositories() - loop := me.repos.View.ReposSortByName() for loop.Scan() { repo := loop.Repo() diff --git a/structs.go b/structs.go index b3c1d79..9dc7936 100644 --- a/structs.go +++ b/structs.go @@ -6,7 +6,6 @@ import ( "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/repolist" "go.wit.com/lib/protobuf/forgepb" - "go.wit.com/lib/protobuf/zoopb" ) var me *autoType @@ -29,10 +28,7 @@ type autoType struct { repos *repoWindow // your customized repo preferences and settings - forge forgepb.Repos - - // use zookeeper to get the list of installed packages - machine zoopb.Machine + forge *forgepb.Forge // #### autotypist Global Build Options // what to change all the branches to