fixing protobuf handling

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-11-06 20:28:31 -06:00
parent 6933b29f59
commit 2de5fd7955
2 changed files with 16 additions and 6 deletions

View File

@ -45,15 +45,19 @@ func doRelease() bool {
} else { } else {
all = append(all, []string{"git", "add", "-f", "go.sum"}) all = append(all, []string{"git", "add", "-f", "go.sum"})
} }
if ok, files, err := me.current.Status.IsProtobuf(); ok { if ok, compiled, err := me.current.Status.IsProtobuf(); ok {
log.Info("\tIsProtobuf() == true") log.Info("\tIsProtobuf() == true")
if err != nil { if err != nil {
log.Info("\tERROR: There are protobuf files, but they are not compiled") log.Info("\tERROR: There are protobuf files, but they are not compiled")
log.Info("\tERROR: can not continue") log.Info("\tERROR: can not continue")
os.Exit(-1)
} }
log.Info("\tshould add the protobuf files here") log.Info("\tshould add the protobuf files here")
log.Info("\tfiles found:", files) log.Info("\tcompiled files found:", compiled)
//all = append(all, []string{"git", "add", "-f", "go.sum"}) for _, s := range compiled {
log.Info("\tcompiled file found:", s)
all = append(all, []string{"git", "add", "-f", s})
}
} else { } else {
log.Info("\tIsProtobuf() == false") log.Info("\tIsProtobuf() == false")
} }

12
http.go
View File

@ -187,9 +187,15 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
} else { } else {
msg(w, "IsPrimitive() == false") msg(w, "IsPrimitive() == false")
} }
if ok, files, err := me.current.Status.IsProtobuf(); ok { if ok, compiled, err := me.current.Status.IsProtobuf(); ok {
msg(w, log.Sprint("IsProtobuf() == true files = ", files)) msg(w, log.Sprint("IsProtobuf() == true compiled protobuf files = ", compiled))
msg(w, log.Sprint("IsProtobuf() == err", err)) if err != nil {
msg(w, log.Sprint("IsProtobuf() == err", err))
os.Exit(-1)
}
for _, s := range compiled {
log.Info("\tcompiled file found:", s)
}
} else { } else {
msg(w, "IsProtobuf() == false") msg(w, "IsProtobuf() == false")
msg(w, log.Sprint("IsProtobuf() == err", err)) msg(w, log.Sprint("IsProtobuf() == err", err))