Remove username requirement

This commit is contained in:
2026-07-07 02:58:28 -04:00
parent 0432aa5548
commit 29067c1b78
2 changed files with 6 additions and 7 deletions
+5 -6
View File
@@ -34,16 +34,15 @@ type giteaRespT struct {
func main() {
// args
if len(os.Args) < 3 {
fmt.Println("Usage: " + os.Args[0] + " <base url> <username> [output organization]\n\nAPI token can be piped into stdin to run non-interactively!")
if len(os.Args) < 2 {
fmt.Println("Usage: " + os.Args[0] + " <base url> [output organization]\n\nAPI token can be piped into stdin to run non-interactively!")
os.Exit(0)
}
baseURL := os.Args[1]
apiURL := baseURL + "/api/v1/repos/search?sort=updated&order=asc&limit=999"
username := os.Args[2]
var organization string
if len(os.Args) == 4 {
organization = os.Args[3]
if len(os.Args) == 3 {
organization = os.Args[2]
}
fmt.Print("Input token: ")
token := back.ReadFromStdin()
@@ -168,7 +167,7 @@ repoLoop:
Force: true,
ClientOptions: []gitclient.Option{
gitclient.WithHTTPAuth(&githttp.BasicAuth{
Username: username,
Username: "null",
Password: string(token),
}),
},