mirror of
https://github.com/cooperspencer/gickup.git
synced 2026-10-19 16:16:46 +00:00
debug msgs and check if pushedat is nil (#227)
This commit is contained in:
@@ -59,6 +59,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
exclude := types.GetMap(repo.Exclude)
|
||||
|
||||
for _, r := range repositories.Items {
|
||||
sub.Debug().Msg(r.Links["clone"].([]interface{})[0].(map[string]interface{})["href"].(string))
|
||||
user := repo.User
|
||||
if r.Owner != nil {
|
||||
if _, ok := r.Owner["nickname"]; ok {
|
||||
|
||||
@@ -295,6 +295,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
}
|
||||
|
||||
if len(repo.Filter.Languages) > 0 {
|
||||
sub.Debug().Msg(r.HTMLURL)
|
||||
langs, _, err := client.GetRepoLanguages(r.Owner.UserName, r.Name)
|
||||
if err != nil {
|
||||
sub.Error().
|
||||
|
||||
@@ -219,6 +219,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
languages := types.GetMap(repo.Filter.Languages)
|
||||
|
||||
for _, r := range githubrepos {
|
||||
sub.Debug().Msg(*r.CloneURL)
|
||||
if repo.Filter.ExcludeForks {
|
||||
if *r.Fork {
|
||||
continue
|
||||
@@ -241,6 +242,9 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
if *r.StargazersCount < repo.Filter.Stars {
|
||||
continue
|
||||
}
|
||||
if r.PushedAt == nil {
|
||||
continue
|
||||
}
|
||||
if time.Since(r.PushedAt.Time) > repo.Filter.LastActivityDuration && repo.Filter.LastActivityDuration != 0 {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -203,6 +203,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
}
|
||||
|
||||
if len(repo.Filter.Languages) > 0 {
|
||||
sub.Debug().Msg(r.WebURL)
|
||||
langs, _, err := client.Projects.GetProjectLanguages(r.ID)
|
||||
if err != nil {
|
||||
sub.Error().
|
||||
|
||||
@@ -172,6 +172,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
excludeorgs := types.GetMap(repo.ExcludeOrgs)
|
||||
|
||||
for _, r := range gogsrepos {
|
||||
sub.Debug().Msg(r.HTMLURL)
|
||||
if repo.Filter.ExcludeForks {
|
||||
if r.Fork {
|
||||
continue
|
||||
|
||||
+7
-7
@@ -84,6 +84,13 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
}
|
||||
|
||||
for _, r := range userrepos {
|
||||
urls, _, err := client.GetCloneUrl(r.ID)
|
||||
if err != nil {
|
||||
sub.Error().
|
||||
Msg("couldn't get clone urls")
|
||||
continue
|
||||
}
|
||||
sub.Debug().Msg(urls.HTTP)
|
||||
if repo.Filter.ExcludeForks {
|
||||
if r.ForkedFromID != 0 {
|
||||
continue
|
||||
@@ -98,13 +105,6 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
}
|
||||
}
|
||||
|
||||
urls, _, err := client.GetCloneUrl(r.ID)
|
||||
if err != nil {
|
||||
sub.Error().
|
||||
Msg("couldn't get clone urls")
|
||||
continue
|
||||
}
|
||||
|
||||
defaultbranch, _, err := client.GetDefaultBranch(r.ID)
|
||||
if err != nil {
|
||||
sub.Error().
|
||||
|
||||
@@ -203,6 +203,7 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
|
||||
for _, r := range repositories.Results {
|
||||
repoURL := fmt.Sprintf("%s%s/%s", repo.URL, repo.User, r.Name)
|
||||
sshURL := fmt.Sprintf("git@%s:%s/%s", types.GetHost(repo.URL), r.Owner.CanonicalName, r.Name)
|
||||
sub.Debug().Msg(repoURL)
|
||||
|
||||
refs, err := getRefs(apiURL, r.Name, token)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user