forked from toolshed/abra
test: moar integration tests [ci skip]
This commit is contained in:
@ -4,7 +4,6 @@ import (
|
||||
"coopcloud.tech/abra/cli/internal"
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/recipe"
|
||||
"coopcloud.tech/abra/pkg/runtime"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
@ -17,25 +16,26 @@ var recipeFetchCommand = cli.Command{
|
||||
Description: "Fetchs all recipes without arguments.",
|
||||
Flags: []cli.Flag{
|
||||
internal.DebugFlag,
|
||||
internal.OfflineFlag,
|
||||
internal.NoInputFlag,
|
||||
},
|
||||
Before: internal.SubCommandBefore,
|
||||
BashComplete: autocomplete.RecipeNameComplete,
|
||||
Action: func(c *cli.Context) error {
|
||||
conf := runtime.New(runtime.WithOffline(internal.Offline))
|
||||
recipeName := c.Args().First()
|
||||
|
||||
if recipeName != "" {
|
||||
internal.ValidateRecipe(c, conf)
|
||||
return nil // ValidateRecipe ensures latest checkout
|
||||
internal.ValidateRecipe(c)
|
||||
}
|
||||
|
||||
repos, err := recipe.ReadReposMetadata(conf)
|
||||
if err != nil {
|
||||
if err := recipe.EnsureExists(recipeName); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipe.UpdateRepositories(repos, recipeName, conf); err != nil {
|
||||
if err := recipe.EnsureUpToDate(recipeName); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipe.EnsureLatest(recipeName); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user