shortcut to get the age of a repo

This commit is contained in:
Jeff Carr 2024-12-14 11:28:34 -06:00
parent 1e4b0c0d37
commit 5341a70557
1 changed files with 9 additions and 0 deletions

View File

@ -29,3 +29,12 @@ func (a GitTagAge) Less(i, j int) bool {
return false
}
func (a GitTagAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
func (repo *Repo) NewestAge() time.Duration {
all := repo.Tags.SortByAge()
for all.Scan() {
r := all.Next()
return time.Since(r.GetAuthordate().AsTime())
}
return time.Since(time.Now())
}