update deps, instructions

This commit is contained in:
2023-05-29 12:46:28 -07:00
parent 2e1ca191ea
commit ab5f213f3b
9 changed files with 93 additions and 98 deletions

33
cmd/mgfetch/main.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import (
"fmt"
"os"
"time"
git "github.com/go-git/go-git/v5"
"github.com/taigrr/gico/commits"
)
type Repo git.Repository
func main() {
year := time.Now().Year()
aName, _ := commits.GetAuthorName()
aEmail, _ := commits.GetAuthorEmail()
authors := []string{aName, aEmail}
mr, err := commits.GetRepos()
if err != nil {
panic(err)
}
if len(mr) == 0 {
fmt.Println("found no repos!")
os.Exit(1)
}
gfreq, err := mr.FrequencyChan(year, authors)
if err != nil {
panic(err)
}
fmt.Print(gfreq.String())
}