1
1
mirror of https://github.com/cooperspencer/gickup synced 2024-11-08 12:09:18 +01:00

Bitbucket nil (#68)

* set user to repo user

* fix second user
This commit is contained in:
Andreas Wachter 2021-12-23 18:54:22 +01:00 committed by GitHub
parent ba45da76b9
commit 3f235a8d14
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

@ -32,15 +32,21 @@ func Get(conf *types.Conf) []types.Repo {
exclude := types.GetMap(repo.Exclude)
for _, r := range repositories.Items {
user := repo.User
if r.Owner != nil {
if _, ok := r.Owner["nickname"]; ok {
user = r.Owner["nickname"].(string)
}
}
if include[r.Name] {
repos = append(repos, types.Repo{Name: r.Name, Url: r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string), SshUrl: r.Links["clone"].([]interface{})[1].(map[string]interface{})["href"].(string), Token: "", Defaultbranch: r.Mainbranch.Name, Origin: repo, Owner: r.Owner["nickname"].(string), Hoster: types.GetHost(repo.Url)})
repos = append(repos, types.Repo{Name: r.Name, Url: r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string), SshUrl: r.Links["clone"].([]interface{})[1].(map[string]interface{})["href"].(string), Token: "", Defaultbranch: r.Mainbranch.Name, Origin: repo, Owner: user, Hoster: types.GetHost(repo.Url)})
continue
}
if exclude[r.Name] {
continue
}
if len(include) == 0 {
repos = append(repos, types.Repo{Name: r.Name, Url: r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string), SshUrl: r.Links["clone"].([]interface{})[1].(map[string]interface{})["href"].(string), Token: "", Defaultbranch: r.Mainbranch.Name, Origin: repo, Owner: r.Owner["nickname"].(string), Hoster: types.GetHost(repo.Url)})
repos = append(repos, types.Repo{Name: r.Name, Url: r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string), SshUrl: r.Links["clone"].([]interface{})[1].(map[string]interface{})["href"].(string), Token: "", Defaultbranch: r.Mainbranch.Name, Origin: repo, Owner: user, Hoster: types.GetHost(repo.Url)})
}
}
}