diff --git a/cmd/repo-search.go b/cmd/repo-search.go index 2a2841e..7d1cd21 100644 --- a/cmd/repo-search.go +++ b/cmd/repo-search.go @@ -15,16 +15,6 @@ import ( var limit string // max num results var userName string -func getUserByName(userName string) (user *gogs.User, err error) { - user, err = GetClient().GetUserInfo(userName) - if err != nil { - fmt.Println(err) - return - } - - return user, err -} - func searchRepos(uid, query, limit string) ([]*gogs.Repository, error) { client := &http.Client{} diff --git a/cmd/repo.go b/cmd/repo.go index 777b7a5..72ec243 100644 --- a/cmd/repo.go +++ b/cmd/repo.go @@ -17,6 +17,7 @@ var repoCmd = &cobra.Command{ $ gogs repo new my-new-repo --private $ gogs repo create my-new-repo --org=JustUsGuys $ gogs repo list + $ gogs repo migrate ia/my-copy-cat https://github.com/gogits/gogs.git $ gogs repo destroy ia my-new-repo $ gogs repo destroy ia/my-new-repo diff --git a/cmd/util.go b/cmd/util.go index 7172da8..828d91f 100644 --- a/cmd/util.go +++ b/cmd/util.go @@ -1,16 +1,10 @@ -// This sucker is really annoying. Gogs Client says that search is a thing. -// And it is, it does work. -// But... I can't find it in the package. It's just not there. I've looked. -// So this is a re-write of the respondering methods that are nonexported in -// the Gogs Client package. Here they're used exclusively (and tweaked a little, as such) -// for the search command. -// It's dumb. I know. package cmd import ( "encoding/json" "errors" + "fmt" "io" "io/ioutil" "net/http" @@ -19,6 +13,26 @@ import ( "github.com/spf13/viper" ) +// Useful for getting dat uid. +func getUserByName(userName string) (user *gogs.User, err error) { + user, err = GetClient().GetUserInfo(userName) + if err != nil { + fmt.Println(err) + return + } + + return user, err +} + + +// This sucker is really annoying. Gogs Client says that search is a thing. +// And it is, it does work. +// But... I can't find it in the package. It's just not there. I've looked. +// So this is a re-write of the respondering methods that are nonexported in +// the Gogs Client package. Here they're used exclusively (and tweaked a little, as such) +// for the search command. +// It's dumb. I know. + type expRes struct { Data []*gogs.Repository `json:"data"` }