From 6db5922be895652b057f7cf823c8c4b4d6cd45d0 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 7 Jul 2026 17:57:31 -0400 Subject: [PATCH] Require organization --- README.md | 4 +++- main.go | 9 +++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6c32e1d..57af8c4 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,9 @@ ENABLE_PUSH_CREATE_USER = true ENABLE_PUSH_CREATE_ORG = true ``` -Optionally, create a new organization in your Gitea instance to store your `ggv` vendor repos. +Create a new organization in your Gitea instance to store your `ggv` vendor repos. +This is necessary not just to keep your Gitea clean, but also to tell `ggv` what repos to ignore as inputs +(you don't want to vendor your vendor repos!). > [!WARNING] >It is recommended to create a user that only has access to that one organization and use said new user to generate the below API key. diff --git a/main.go b/main.go index 870c30b..e79ffa6 100644 --- a/main.go +++ b/main.go @@ -34,16 +34,13 @@ type giteaRespT struct { func main() { // args - if len(os.Args) < 2 { - fmt.Println("Usage: " + os.Args[0] + " [output organization]\n\nAPI token can be piped into stdin to run non-interactively!") + if len(os.Args) < 3 { + fmt.Println("Usage: " + os.Args[0] + " \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" - var organization string - if len(os.Args) == 3 { - organization = os.Args[2] - } + organization := os.Args[2] fmt.Print("Input token: ") token := back.ReadFromStdin() if len(token) == 0 {