summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/main.go b/main.go
index cbff6a6..18cff07 100644
--- a/main.go
+++ b/main.go
@@ -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 {