From 2de5fd79554a3407f34e8b3adbb62da75fe7aa90 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 6 Nov 2024 20:28:31 -0600 Subject: [PATCH] fixing protobuf handling Signed-off-by: Jeff Carr --- doRelease.go | 10 +++++++--- http.go | 12 +++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/doRelease.go b/doRelease.go index 71baa57..9b69d3f 100644 --- a/doRelease.go +++ b/doRelease.go @@ -45,15 +45,19 @@ func doRelease() bool { } else { 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") if err != nil { log.Info("\tERROR: There are protobuf files, but they are not compiled") log.Info("\tERROR: can not continue") + os.Exit(-1) } log.Info("\tshould add the protobuf files here") - log.Info("\tfiles found:", files) - //all = append(all, []string{"git", "add", "-f", "go.sum"}) + log.Info("\tcompiled files found:", compiled) + for _, s := range compiled { + log.Info("\tcompiled file found:", s) + all = append(all, []string{"git", "add", "-f", s}) + } } else { log.Info("\tIsProtobuf() == false") } diff --git a/http.go b/http.go index 08074d7..791392c 100644 --- a/http.go +++ b/http.go @@ -187,9 +187,15 @@ func okHandler(w http.ResponseWriter, r *http.Request) { } else { msg(w, "IsPrimitive() == false") } - if ok, files, err := me.current.Status.IsProtobuf(); ok { - msg(w, log.Sprint("IsProtobuf() == true files = ", files)) - msg(w, log.Sprint("IsProtobuf() == err", err)) + if ok, compiled, err := me.current.Status.IsProtobuf(); ok { + msg(w, log.Sprint("IsProtobuf() == true compiled protobuf files = ", compiled)) + if err != nil { + msg(w, log.Sprint("IsProtobuf() == err", err)) + os.Exit(-1) + } + for _, s := range compiled { + log.Info("\tcompiled file found:", s) + } } else { msg(w, "IsProtobuf() == false") msg(w, log.Sprint("IsProtobuf() == err", err))