diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -1,4 +1,6 @@ +//go:build go1.20 // +build go1.20 + package main import ( @@ -7,6 +9,7 @@ import ( "github.com/alexflint/go-arg" "go.wit.com/lib/gui/shell" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/log" "golang.org/x/text/cases" "golang.org/x/text/language" @@ -17,6 +20,7 @@ var VERSION string var BUILDTIME string var sortmap map[string]string +var forge *forgepb.Forge // forgepb figures out how to run protoc correctly if it's needed func main() { pp := arg.MustParse(&argv) @@ -48,7 +52,6 @@ func main() { if !shell.Exists("go.sum") { shell.Run([]string{"go", "mod", "init"}) shell.Run([]string{"go", "mod", "tidy"}) - shell.Run([]string{"go", "mod", "edit", "-go=1.20"}) } cmd := []string{"go", "list", "-f", "'{{.Name}}'"} @@ -86,6 +89,16 @@ func main() { os.Exit(0) } + sortmap["protoc"] = protobase + ".pb.go" + if !shell.Exists(sortmap["protoc"]) { + if err := protocBuild(sortmap); err != nil { + log.Info("protoc build error:", err) + os.Exit(-1) + } + os.Exit(0) + } + os.Exit(0) + // add mutex if err := addMutex(sortmap); err == nil { log.Info("adding mutex to existing protoc-gen-go file worked") |
