This commit is contained in:
@ -7,7 +7,6 @@ import (
|
||||
"coopcloud.tech/abra/pkg/autocomplete"
|
||||
"coopcloud.tech/abra/pkg/formatter"
|
||||
"coopcloud.tech/abra/pkg/lint"
|
||||
recipePkg "coopcloud.tech/abra/pkg/recipe"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
@ -27,24 +26,27 @@ var recipeLintCommand = cli.Command{
|
||||
Before: internal.SubCommandBefore,
|
||||
BashComplete: autocomplete.RecipeNameComplete,
|
||||
Action: func(c *cli.Context) error {
|
||||
recipe := internal.ValidateRecipe(c)
|
||||
r := internal.ValidateRecipe(c)
|
||||
if err := r.LoadConfig(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if err := recipePkg.EnsureExists(recipe.Name); err != nil {
|
||||
if err := r.EnsureExists(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if !internal.Chaos {
|
||||
if err := recipePkg.EnsureIsClean(recipe.Name); err != nil {
|
||||
if err := r.EnsureIsClean(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
|
||||
if !internal.Offline {
|
||||
if err := recipePkg.EnsureUpToDate(recipe.Name); err != nil {
|
||||
if err := r.EnsureUpToDate(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
if err := recipePkg.EnsureLatest(recipe.Name); err != nil {
|
||||
if err := r.EnsureLatest(); err != nil {
|
||||
logrus.Fatal(err)
|
||||
}
|
||||
}
|
||||
@ -62,7 +64,7 @@ var recipeLintCommand = cli.Command{
|
||||
}
|
||||
|
||||
skipped := false
|
||||
if rule.Skip(recipe) {
|
||||
if rule.Skip(r) {
|
||||
skipped = true
|
||||
}
|
||||
|
||||
@ -73,7 +75,7 @@ var recipeLintCommand = cli.Command{
|
||||
|
||||
satisfied := false
|
||||
if !skipped {
|
||||
ok, err := rule.Function(recipe)
|
||||
ok, err := rule.Function(r)
|
||||
if err != nil {
|
||||
logrus.Warn(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user