add NewestAge(). this is dumb. move this to gitpb

This commit is contained in:
Jeff Carr 2024-12-14 10:48:08 -06:00
parent b715fdd11a
commit d20ce6b0e8
2 changed files with 10 additions and 2 deletions

View File

@ -48,6 +48,14 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
return 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 not GoPrimitive, autogen each dependent git repo
if repo.GoDepsLen() != 0 { if repo.GoDepsLen() != 0 {
// build the protobuf files in all protobuf repos // build the protobuf files in all protobuf repos

View File

@ -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() all := repo.Tags.SortByAge()
for all.Scan() { for all.Scan() {
r := all.Next() r := all.Next()
@ -64,7 +64,7 @@ func (f *Forge) StandardReleaseHeader(repo *gitpb.Repo, state string) string {
lastTag := repo.GetLastTag() lastTag := repo.GetLastTag()
// tag := repo.NewestTag() // tag := repo.NewestTag()
// gitAge, _ := tag.GetDate() // gitAge, _ := tag.GetDate()
dur := f.newestAge(repo) dur := f.NewestAge(repo)
curname := repo.GetCurrentBranchName() curname := repo.GetCurrentBranchName()
master := repo.GetMasterVersion() master := repo.GetMasterVersion()