refactor(recipe): remove remaining usage of old recipe struct

This commit is contained in:
2024-07-08 13:15:20 +02:00
parent c1b03bcbd7
commit 5617a9ba07
24 changed files with 167 additions and 189 deletions

View File

@ -13,7 +13,7 @@ import (
)
// ValidateRecipe ensures the recipe arg is valid.
func ValidateRecipe(c *cli.Context) recipe.Recipe {
func ValidateRecipe(c *cli.Context) recipe.Recipe2 {
recipeName := c.Args().First()
if recipeName == "" && !NoInput {
@ -57,7 +57,12 @@ func ValidateRecipe(c *cli.Context) recipe.Recipe {
ShowSubcommandHelpAndError(c, errors.New("no recipe name provided"))
}
chosenRecipe, err := recipe.Get(recipeName, Offline)
chosenRecipe := recipe.Get2(recipeName)
err := chosenRecipe.EnsureExists()
if err != nil {
log.Fatal(err)
}
_, err = chosenRecipe.GetComposeConfig(nil)
if err != nil {
if c.Command.Name == "generate" {
if strings.Contains(err.Error(), "missing a compose") {