mirror of
https://github.com/taigrr/gico.git
synced 2026-04-02 03:09:07 -07:00
update deps, instructions
This commit is contained in:
33
cmd/mgfetch/main.go
Normal file
33
cmd/mgfetch/main.go
Normal 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())
|
||||
}
|
||||
Reference in New Issue
Block a user