示例#1
0
文件: github.go 项目: rogaha/gordon
func NewMaintainerManager(client *gh.Client, org, repo string) (*MaintainerManager, error) {

	config, err := LoadConfig()
	if err == nil {
		client.WithToken(config.Token)
	}
	originPath, err := getOriginPath(repo)
	if err != nil {
		return nil, err
	}
	email, err := GetMaintainerManagerEmail()
	if err != nil {
		return nil, err
	}
	err = createMaintainerManagersDirectoriesMap(originPath, "", email, config.UserName)
	if err != nil {
		return nil, err
	}
	return &MaintainerManager{
		repo:              gh.Repo{Name: repo, UserName: org},
		client:            client,
		maintainerDirMap:  &maintainerDirMap,
		email:             email,
		maintainersIds:    &maintainersIds,
		maintainersDirMap: &maintainersDirMap,
	}, nil
}
示例#2
0
文件: github.go 项目: jamtur01/pulls
func NewMaintainer(client *gh.Client, org, repo string) (*Maintainer, error) {

	config, err := LoadConfig()
	if err == nil {
		client.WithToken(config.Token)
	}

	return &Maintainer{
		repo:   gh.Repo{Name: repo, UserName: org},
		client: client,
	}, nil
}
示例#3
0
文件: github.go 项目: askb/gordon
func NewMaintainerManager(client *gh.Client, org, repo string) (*MaintainerManager, error) {
	config, err := LoadConfig()
	if err == nil {
		client.WithToken(config.Token)
	}
	originPath, err := getOriginPath(repo)
	if err != nil {
		return nil, fmt.Errorf("getoriginpath: %v", err)
	}
	email, err := GetMaintainerManagerEmail()
	if err != nil {
		return nil, fmt.Errorf("getemail: %v", err)
	}
	return &MaintainerManager{
		repo:       gh.Repo{Name: repo, UserName: org},
		client:     client,
		email:      email,
		originPath: originPath,
		username:   config.UserName,
	}, nil
}