Skip to content

Commit

Permalink
don't look up workspaces if token is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperspencer committed Aug 20, 2024
1 parent 256dac8 commit c2aefbe
Showing 1 changed file with 24 additions and 22 deletions.
46 changes: 24 additions & 22 deletions bitbucket/bitbucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,31 +68,33 @@ func Get(conf *types.Conf) ([]types.Repo, bool) {
continue
}

workspaces, err := client.Workspaces.List()
if err != nil {
sub.Error().
Msg(err.Error())
} else {
for _, workspace := range workspaces.Workspaces {
if workspace.Slug != repo.User {
if len(includeorgs) > 0 {
if !includeorgs[workspace.Slug] {
continue
if repo.Token != "" {
workspaces, err := client.Workspaces.List()
if err != nil {
sub.Error().
Msg(err.Error())
} else {
for _, workspace := range workspaces.Workspaces {
if workspace.Slug != repo.User {
if len(includeorgs) > 0 {
if !includeorgs[workspace.Slug] {
continue
}
}
}
if len(excludeorgs) > 0 {
if excludeorgs[workspace.Slug] {
continue
if len(excludeorgs) > 0 {
if excludeorgs[workspace.Slug] {
continue
}
}
workspacerepos, err := client.Repositories.ListForAccount(&bitbucket.RepositoriesOptions{Owner: workspace.Slug})
if err != nil {
sub.Error().
Msg(err.Error())
} else {
repositories.Items = append(repositories.Items, workspacerepos.Items...)
}
}
workspacerepos, err := client.Repositories.ListForAccount(&bitbucket.RepositoriesOptions{Owner: workspace.Slug})
if err != nil {
sub.Error().
Msg(err.Error())
} else {
repositories.Items = append(repositories.Items, workspacerepos.Items...)
}

}
}
}
}
Expand Down

0 comments on commit c2aefbe

Please sign in to comment.