mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-04 02:48:29 +02:00
migrate tea to urfave v3 (#760)
I tested this somewhat, but I haven't been using the cli before so I'm not sure if there are changes - there shouldn't be though. Reviewed-on: https://gitea.com/gitea/tea/pulls/760 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
17
cmd/clone.go
17
cmd/clone.go
@ -4,6 +4,7 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
stdctx "context"
|
||||
"fmt"
|
||||
|
||||
"code.gitea.io/tea/cmd/flags"
|
||||
@ -14,7 +15,7 @@ import (
|
||||
"code.gitea.io/tea/modules/task"
|
||||
"code.gitea.io/tea/modules/utils"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
// CmdRepoClone represents a sub command of repos to create a local copy
|
||||
@ -45,18 +46,18 @@ When a host is specified in the repo-slug, it will override the login specified
|
||||
},
|
||||
}
|
||||
|
||||
func runRepoClone(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
func runRepoClone(ctx stdctx.Context, cmd *cli.Command) error {
|
||||
teaCmd := context.InitCommand(cmd)
|
||||
|
||||
args := ctx.Args()
|
||||
args := teaCmd.Args()
|
||||
if args.Len() < 1 {
|
||||
return cli.ShowCommandHelp(cmd, "clone")
|
||||
return cli.ShowCommandHelp(ctx, cmd, "clone")
|
||||
}
|
||||
dir := args.Get(1)
|
||||
|
||||
var (
|
||||
login *config.Login = ctx.Login
|
||||
owner string = ctx.Login.User
|
||||
login *config.Login = teaCmd.Login
|
||||
owner string = teaCmd.Login.User
|
||||
repo string
|
||||
)
|
||||
|
||||
@ -81,7 +82,7 @@ func runRepoClone(cmd *cli.Context) error {
|
||||
owner,
|
||||
repo,
|
||||
interact.PromptPassword,
|
||||
ctx.Int("depth"),
|
||||
teaCmd.Int("depth"),
|
||||
)
|
||||
|
||||
return err
|
||||
|
Reference in New Issue
Block a user