From d20ce6b0e8153f41421b6c245a8a5ab5aac079f7 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 14 Dec 2024 10:48:08 -0600 Subject: [PATCH] add NewestAge(). this is dumb. move this to gitpb --- build.go | 8 ++++++++ human.go | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/build.go b/build.go index 579d738..327a19e 100644 --- a/build.go +++ b/build.go @@ -48,6 +48,14 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err return err } + if repo.Exists(".forge") { + log.Info("custom build instructions") + data, _ := repo.ReadFile(".forge") + log.Info(".forge =", string(data)) + log.Info("todo: do the custom build instructions") + return nil + } + // if not GoPrimitive, autogen each dependent git repo if repo.GoDepsLen() != 0 { // build the protobuf files in all protobuf repos diff --git a/human.go b/human.go index 80dd04e..1d6a9c5 100644 --- a/human.go +++ b/human.go @@ -50,7 +50,7 @@ func (f *Forge) ConfigPrintTable() { } } -func (f *Forge) newestAge(repo *gitpb.Repo) time.Duration { +func (f *Forge) NewestAge(repo *gitpb.Repo) time.Duration { all := repo.Tags.SortByAge() for all.Scan() { r := all.Next() @@ -64,7 +64,7 @@ func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string { lastTag := repo.GetLastTag() // tag := repo.NewestTag() // gitAge, _ := tag.GetDate() - dur := f.newestAge(repo) + dur := f.NewestAge(repo) curname := repo.GetCurrentBranchName() master := repo.GetMasterVersion()