fix: ensure recipes on latest for lint/generate
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Follows b2d17a1829
.
This commit is contained in:
@ -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" {
|
||||
|
Reference in New Issue
Block a user