forked from toolshed/abra
refactor: urfave v3
This commit is contained in:
@ -1,12 +1,14 @@
|
||||
package recipe
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/formatter"
|
||||
"coopcloud.tech/abra/pkg/log"
|
||||
"coopcloud.tech/abra/pkg/recipe"
|
||||
"github.com/urfave/cli/v2"
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
var recipeFetchCommand = cli.Command{
|
||||
@ -20,13 +22,14 @@ var recipeFetchCommand = cli.Command{
|
||||
internal.NoInputFlag,
|
||||
internal.OfflineFlag,
|
||||
},
|
||||
Before: internal.SubCommandBefore,
|
||||
BashComplete: autocomplete.RecipeNameComplete,
|
||||
Action: func(c *cli.Context) error {
|
||||
recipeName := c.Args().First()
|
||||
Before: internal.SubCommandBefore,
|
||||
EnableShellCompletion: true,
|
||||
ShellComplete: autocomplete.RecipeNameComplete,
|
||||
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||
recipeName := cmd.Args().First()
|
||||
r := recipe.Get(recipeName)
|
||||
if recipeName != "" {
|
||||
internal.ValidateRecipe(c)
|
||||
internal.ValidateRecipe(cmd)
|
||||
if err := r.Ensure(false, false); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user