fix: ensure recipes on latest for lint/generate
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Follows b2d17a1829
.
This commit is contained in:
parent
b2d17a1829
commit
bdd9b0a1aa
|
@ -94,7 +94,7 @@ keys configured on your account.
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
recipeName := c.Args().First()
|
recipeName := c.Args().First()
|
||||||
if recipeName != "" {
|
if recipeName != "" {
|
||||||
internal.ValidateRecipe(c)
|
internal.ValidateRecipe(c, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
repos, err := recipe.ReadReposMetadata()
|
repos, err := recipe.ReadReposMetadata()
|
||||||
|
|
|
@ -19,13 +19,19 @@ import (
|
||||||
var AppName string
|
var AppName string
|
||||||
|
|
||||||
// ValidateRecipe ensures the recipe arg is valid.
|
// 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()
|
recipeName := c.Args().First()
|
||||||
|
|
||||||
if recipeName == "" {
|
if recipeName == "" {
|
||||||
ShowSubcommandHelpAndError(c, errors.New("no recipe name provided"))
|
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)
|
chosenRecipe, err := recipe.Get(recipeName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if c.Command.Name == "generate" {
|
if c.Command.Name == "generate" {
|
||||||
|
|
|
@ -24,7 +24,7 @@ var recipeLintCommand = cli.Command{
|
||||||
Before: internal.SubCommandBefore,
|
Before: internal.SubCommandBefore,
|
||||||
BashComplete: autocomplete.RecipeNameComplete,
|
BashComplete: autocomplete.RecipeNameComplete,
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
recipe := internal.ValidateRecipe(c)
|
recipe := internal.ValidateRecipe(c, true)
|
||||||
|
|
||||||
if err := recipePkg.EnsureUpToDate(recipe.Name); err != nil {
|
if err := recipePkg.EnsureUpToDate(recipe.Name); err != nil {
|
||||||
logrus.Fatal(err)
|
logrus.Fatal(err)
|
||||||
|
|
|
@ -20,7 +20,7 @@ var recipeVersionCommand = cli.Command{
|
||||||
Before: internal.SubCommandBefore,
|
Before: internal.SubCommandBefore,
|
||||||
BashComplete: autocomplete.RecipeNameComplete,
|
BashComplete: autocomplete.RecipeNameComplete,
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
recipe := internal.ValidateRecipe(c)
|
recipe := internal.ValidateRecipe(c, false)
|
||||||
|
|
||||||
catalogue, err := recipePkg.ReadRecipeCatalogue()
|
catalogue, err := recipePkg.ReadRecipeCatalogue()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue