mirror of
https://github.com/taigrr/gico.git
synced 2026-04-01 18:58:59 -07:00
fix getAuthor/Email funcs
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
|||||||
"github.com/charmbracelet/bubbles/key"
|
"github.com/charmbracelet/bubbles/key"
|
||||||
tea "github.com/charmbracelet/bubbletea"
|
tea "github.com/charmbracelet/bubbletea"
|
||||||
"github.com/charmbracelet/lipgloss"
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
|
||||||
"github.com/taigrr/gico/commits"
|
"github.com/taigrr/gico/commits"
|
||||||
"github.com/taigrr/gico/types"
|
"github.com/taigrr/gico/types"
|
||||||
)
|
)
|
||||||
@@ -185,15 +186,20 @@ func NewCommitLog() (CommitLog, error) {
|
|||||||
now := time.Now()
|
now := time.Now()
|
||||||
today := now.YearDay() - 1
|
today := now.YearDay() - 1
|
||||||
year := now.Year()
|
year := now.Year()
|
||||||
aName, _ := commits.GetAuthorName()
|
aName, err := commits.GetAuthorName()
|
||||||
aEmail, _ := commits.GetAuthorEmail()
|
if err != nil {
|
||||||
authors := []string{aName, aEmail}
|
return m, err
|
||||||
|
}
|
||||||
|
aEmail, err := commits.GetAuthorEmail()
|
||||||
|
if err != nil {
|
||||||
|
return m, err
|
||||||
|
}
|
||||||
mr, err := commits.GetMRRepos()
|
mr, err := commits.GetMRRepos()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return m, err
|
return m, err
|
||||||
}
|
}
|
||||||
|
m.Authors = []string{aName, aEmail}
|
||||||
m.Repos = mr
|
m.Repos = mr
|
||||||
m.Authors = authors
|
|
||||||
m.Year = year
|
m.Year = year
|
||||||
m.Selected = today
|
m.Selected = today
|
||||||
m.Commits, err = mr.GetRepoCommits(m.Year, m.Authors)
|
m.Commits, err = mr.GetRepoCommits(m.Year, m.Authors)
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ func (paths RepoSet) GetRepoCommits(year int, authors []string) ([][]types.Commi
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
cc = FilterCChanByYear(cc, year)
|
cc = FilterCChanByYear(cc, year)
|
||||||
cc, err = FilterCChanByAuthor(cc, authors)
|
cc2, err := FilterCChanByAuthor(cc, authors)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for c := range cc {
|
for c := range cc2 {
|
||||||
outChan <- c
|
outChan <- c
|
||||||
}
|
}
|
||||||
}(p)
|
}(p)
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ func GetAuthorName() (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return conf.Author.Name, nil
|
return conf.User.Name, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetAuthorEmail() (string, error) {
|
func GetAuthorEmail() (string, error) {
|
||||||
@@ -58,5 +58,5 @@ func GetAuthorEmail() (string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
return conf.Author.Email, nil
|
return conf.User.Email, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user