diff options
| author | Jeff Carr <[email protected]> | 2024-11-30 13:48:50 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-11-30 13:48:50 -0600 |
| commit | b1172af227f7893d29dbad88a47855a95cec8bcc (patch) | |
| tree | f0f85ad6e77ed86df4058fb7494762ea52ab31c9 /main.go | |
| parent | d24d8368993da167be40d6276956f378120af18b (diff) | |
run protoc with the right paths
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -66,6 +66,7 @@ func main() { sortmap = make(map[string]string) sortmap["package"] = packageName + sortmap["protofile"] = argv.Proto sortmap["protobase"] = protobase if argv.LoBase == "" { // if not set, assumed to be protobase @@ -89,15 +90,21 @@ func main() { os.Exit(0) } + // try to make foo.pb.go with protoc if it's not here 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) + + // if foo.pb.go still doesn't exist, protoc failed + // exit here + if !shell.Exists(sortmap["protoc"]) { + log.Info("protoc build error.", sortmap["protoc"], "failed to be created with protoc and proto-gen-go") + os.Exit(-1) + } // add mutex if err := addMutex(sortmap); err == nil { |
