Skip to content

Commit

Permalink
fix: fixed risk of infinite loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Neal-C committed Oct 24, 2024
1 parent 8955ec6 commit 4447593
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions internal/cli/thanos_snap.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ var thanosSnap = &cobra.Command{

fmt.Printf("running as %s\n", user.Username)

var shouldRunAgain bool

payload := map[string]any{
"private": true,
}

run:

publicRepositoriesGithubAPIEndpoint := fmt.Sprintf("https://api.github.com/users/%s/repos?visibility=public&per_page=100", user.Username)

httpResponse, err := client.Request(http.MethodGet, publicRepositoriesGithubAPIEndpoint, nil)
Expand All @@ -87,7 +95,7 @@ var thanosSnap = &cobra.Command{
var namesOfPublicRepositories []string

for _, repo := range publicRepositories {
namesOfPublicRepositories= append(namesOfPublicRepositories, repo.Fullname)
namesOfPublicRepositories = append(namesOfPublicRepositories, repo.Fullname)
}

names, err := Prettyfy(namesOfPublicRepositories)
Expand All @@ -98,14 +106,6 @@ var thanosSnap = &cobra.Command{

fmt.Printf("your public repositories : %s \n", names)

var shouldRunAgain bool

payload := map[string]any{
"private": true,
}

run:

// TODO : lobby github for a batch request endpoint, so that it can be only 1 HTTP call and not O(n) HTTP calls
for _, repo := range publicRepositories {

Expand Down
2 changes: 1 addition & 1 deletion internal/cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
)

var Version = "v0.1.1"
var Version = "v0.1.2"

var versionCmd = &cobra.Command{
Use: "version",
Expand Down

0 comments on commit 4447593

Please sign in to comment.