From 336ab60e0195cc4e96faa36855dccab563a888ab Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Mon, 20 Jan 2025 01:40:47 -0600 Subject: [PATCH] need better handling here --- reloadRepoType.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/reloadRepoType.go b/reloadRepoType.go index d6dbddb..435b82e 100644 --- a/reloadRepoType.go +++ b/reloadRepoType.go @@ -9,6 +9,8 @@ import ( "go.wit.com/log" ) +// TODO: this needs to be redone in a smarter way +// to identify which repos have things to build in them func (repo *Repo) GetRepoType() string { if repo == nil { return "nil" @@ -24,9 +26,6 @@ func (repo *Repo) GetRepoType() string { if repo.GoInfo.GoPlugin { return "plugin" } - if repo.GoInfo.GoProtobuf { - return "protobuf" - } if repo.GoInfo.GoBinary { if repo.Exists(".plugin") { log.Warn("gitpb.RepoType() plugin was not set correctly") @@ -35,6 +34,10 @@ func (repo *Repo) GetRepoType() string { } return "binary" } + // binary should always take precidence over libraries that are protobuf's + if repo.GoInfo.GoProtobuf { + return "protobuf" + } if repo.GoInfo.GoLibrary { return "library" } @@ -48,11 +51,9 @@ func (repo *Repo) setRepoType() { } if repo.Exists(".plugin") { repo.GoInfo.GoPlugin = true - return } if ok, _, _ := repo.IsProtobuf(); ok { repo.GoInfo.GoProtobuf = true - return } switch repo.goListRepoType() { case "binary":