mirror of
https://github.com/taigrr/gico.git
synced 2026-04-02 03:09:07 -07:00
update gitfetch to use builtins, add config option for author
This commit is contained in:
@@ -5,9 +5,11 @@ import (
|
||||
"os"
|
||||
|
||||
git "github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/config"
|
||||
|
||||
"github.com/taigrr/mg/parse"
|
||||
|
||||
"github.com/taigrr/gico/types"
|
||||
"github.com/taigrr/mg/parse"
|
||||
)
|
||||
|
||||
type (
|
||||
@@ -42,3 +44,19 @@ func GetMRRepos() (RepoSet, error) {
|
||||
paths := mrconf.GetRepoPaths()
|
||||
return RepoSet(paths), nil
|
||||
}
|
||||
|
||||
func GetAuthorName() (string, error) {
|
||||
conf, err := config.LoadConfig(config.GlobalScope)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return conf.Author.Name, nil
|
||||
}
|
||||
|
||||
func GetAuthorEmail() (string, error) {
|
||||
conf, err := config.LoadConfig(config.GlobalScope)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return conf.Author.Email, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user