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:
30
cmd/gitfetch/main.go
Normal file
30
cmd/gitfetch/main.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/taigrr/gico/commits"
|
||||
gterm "github.com/taigrr/gico/graph/term"
|
||||
)
|
||||
|
||||
func main() {
|
||||
year := time.Now().Year()
|
||||
dir, err := os.Getwd()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
r, err := commits.OpenRepo(dir)
|
||||
if err != nil {
|
||||
fmt.Println("Error opening current directory as a git repo")
|
||||
os.Exit(1)
|
||||
}
|
||||
cs, err := r.GetCommitSet()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
cs = cs.FilterByYear(year)
|
||||
freq := cs.ToYearFreq()
|
||||
fmt.Print(gterm.GetYearUnicode(freq))
|
||||
}
|
||||
Reference in New Issue
Block a user