mid-merge

This commit is contained in:
2023-01-30 22:32:28 -08:00
parent 62780ba810
commit 38bc9bcf94
5 changed files with 202 additions and 31 deletions

View File

@@ -2,29 +2,22 @@ package main
import (
"fmt"
"math/rand"
"time"
"github.com/taigrr/gico/commits"
"github.com/taigrr/gico/graph/term"
)
func init() {
rand.Seed(time.Now().UnixMilli())
}
func main() {
wfreq := []int{}
yd := time.Now().YearDay()
freq, _ := commits.GlobalFrequency(time.Now().Year(), []string{""})
if yd < 7 {
// xfreq, _ := commits.GlobalFrequency(time.Now().Year()-1, []string{""})
} else {
// TODO fix bug for negative in first week of Jan
for i := 0; i < 7; i++ {
d := time.Now().YearDay() - 1 - 6 + i
wfreq = append(wfreq, freq[d])
}
repoPaths, err := commits.GetMRRepos()
if err != nil {
panic(err)
}
freq, err := repoPaths.GlobalFrequency(time.Now().Year(), []string{""})
if err != nil {
panic(err)
}
fmt.Println("week:")
fmt.Println(term.GetWeekUnicode(wfreq))