diff options
| author | Jeff Carr <[email protected]> | 2025-10-05 03:55:22 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-05 03:55:22 -0500 |
| commit | 952334bf58e49e381171e2c71e20a847f4138df6 (patch) | |
| tree | f430252265c34d30162027c0bf657cfbfe52a841 /tableBuild.go | |
| parent | 8d50f01597cde8c7ae0fd451347d93196b97f900 (diff) | |
code cleanups. old non-protobuf code almost gonev0.0.166
Diffstat (limited to 'tableBuild.go')
| -rw-r--r-- | tableBuild.go | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tableBuild.go b/tableBuild.go new file mode 100644 index 0000000..99f08cb --- /dev/null +++ b/tableBuild.go @@ -0,0 +1,52 @@ +// Copyright 2025 WIT.COM Inc Licensed GPL 3.0 + +package forgepb + +import ( + "go.wit.com/lib/protobuf/gitpb" +) + +// returns +func (f *Forge) GetPackageVersion(repo *gitpb.Repo) string { + var s string + + s = repo.GetCurrentBranchVersion() + if repo.IsDirty() { + s += "-dirty" + } + return s +} + +func (f *Forge) GetRepoType(repo *gitpb.Repo) string { + var rtype string = repo.GetRepoType() + switch rtype { + case "binary": + rtype = "GO bin" + case "library": + rtype = "GO lib" + case "protobuf": + rtype = "GO pb" + } + if f.IsPrivate(repo) { + rtype = "priv" + } + return rtype +} + +func (f *Forge) GetBuildBaseTB(pb *gitpb.Repos) *gitpb.ReposTable { + t := pb.NewTable(".deb details") + t.NewUuid() + + var col *gitpb.RepoFunc + + col = t.AddStringFunc("Build Version", func(r *gitpb.Repo) string { + return f.GetPackageVersion(r) + }) + col.Width = 24 + + col = t.AddStringFunc("RepoType", func(r *gitpb.Repo) string { + return f.GetRepoType(r) + }) + col.Width = 8 + return t +} |
