mirror of
https://gitea.com/gitea/tea.git
synced 2025-12-15 19:02:05 +01:00
When there is no login detected, list all possible logins to select
This commit is contained in:
@@ -7,8 +7,8 @@ import (
|
||||
stdctx "context"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
@@ -103,7 +103,7 @@ var CmdRepoCreate = cli.Command{
|
||||
}
|
||||
|
||||
func runRepoCreate(_ stdctx.Context, cmd *cli.Command) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx := base.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
var (
|
||||
repo *gitea.Repository
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
stdctx "context"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
"github.com/urfave/cli/v3"
|
||||
@@ -83,7 +83,7 @@ var CmdRepoCreateFromTemplate = cli.Command{
|
||||
}
|
||||
|
||||
func runRepoCreateFromTemplate(_ stdctx.Context, cmd *cli.Command) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx := base.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
|
||||
templateOwner, templateRepo := utils.GetOwnerAndRepo(ctx.String("template"), ctx.Login.User)
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
stdctx "context"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
|
||||
"github.com/charmbracelet/huh"
|
||||
"github.com/urfave/cli/v3"
|
||||
@@ -46,7 +46,7 @@ var CmdRepoRm = cli.Command{
|
||||
}
|
||||
|
||||
func runRepoDelete(_ stdctx.Context, cmd *cli.Command) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx := base.InitCommand(cmd)
|
||||
|
||||
client := ctx.Login.Client()
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
stdctx "context"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
@@ -33,7 +34,7 @@ var CmdRepoFork = cli.Command{
|
||||
}
|
||||
|
||||
func runRepoFork(_ stdctx.Context, cmd *cli.Command) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx := base.InitCommand(cmd)
|
||||
ctx.Ensure(context.CtxRequirement{RemoteRepo: true})
|
||||
client := ctx.Login.Client()
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ package repos
|
||||
import (
|
||||
stdctx "context"
|
||||
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
@@ -50,7 +50,7 @@ var CmdReposList = cli.Command{
|
||||
|
||||
// RunReposList list repositories
|
||||
func RunReposList(_ stdctx.Context, cmd *cli.Command) error {
|
||||
teaCmd := context.InitCommand(cmd)
|
||||
teaCmd := base.InitCommand(cmd)
|
||||
client := teaCmd.Login.Client()
|
||||
|
||||
typeFilter, err := getTypeFilter(cmd)
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
stdctx "context"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
@@ -109,7 +109,7 @@ var CmdRepoMigrate = cli.Command{
|
||||
}
|
||||
|
||||
func runRepoMigrate(_ stdctx.Context, cmd *cli.Command) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
ctx := base.InitCommand(cmd)
|
||||
client := ctx.Login.Client()
|
||||
var (
|
||||
repo *gitea.Repository
|
||||
@@ -157,7 +157,6 @@ func runRepoMigrate(_ stdctx.Context, cmd *cli.Command) error {
|
||||
}
|
||||
|
||||
repo, _, err = client.MigrateRepo(opts)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/tea/cmd/base"
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
"code.gitea.io/tea/modules/context"
|
||||
"code.gitea.io/tea/modules/print"
|
||||
|
||||
"code.gitea.io/sdk/gitea"
|
||||
@@ -57,7 +57,7 @@ var CmdReposSearch = cli.Command{
|
||||
}
|
||||
|
||||
func runReposSearch(_ stdctx.Context, cmd *cli.Command) error {
|
||||
teaCmd := context.InitCommand(cmd)
|
||||
teaCmd := base.InitCommand(cmd)
|
||||
client := teaCmd.Login.Client()
|
||||
|
||||
var ownerID int64
|
||||
|
||||
Reference in New Issue
Block a user