fix: ensure recipes on latest for lint/generate

Follows b2d17a1829.
This commit is contained in:
2022-01-29 14:06:25 +01:00
parent b2d17a1829
commit bdd9b0a1aa
4 changed files with 10 additions and 4 deletions

View File

@ -19,13 +19,19 @@ import (
var AppName string
// ValidateRecipe ensures the recipe arg is valid.
func ValidateRecipe(c *cli.Context) recipe.Recipe {
func ValidateRecipe(c *cli.Context, ensureLatest bool) recipe.Recipe {
recipeName := c.Args().First()
if recipeName == "" {
ShowSubcommandHelpAndError(c, errors.New("no recipe name provided"))
}
if ensureLatest {
if err := recipe.EnsureLatest(recipeName); err != nil {
logrus.Fatal(err)
}
}
chosenRecipe, err := recipe.Get(recipeName)
if err != nil {
if c.Command.Name == "generate" {