refator(recipe): remove old struct

This commit is contained in:
p4u1 2024-07-08 13:16:47 +02:00
parent 5617a9ba07
commit f638b6a16b

View File

@ -122,35 +122,6 @@ type Features struct {
SSO string `json:"sso"` SSO string `json:"sso"`
} }
// Recipe represents a recipe.
type Recipe struct {
Name string
Meta RecipeMeta
}
// Get retrieves a recipe.
func Get(recipeName string, offline bool) (Recipe, error) {
r := Get2(recipeName)
if err := r.EnsureExists(); err != nil {
return Recipe{}, err
}
meta, err := GetRecipeMeta(r.Name, offline)
if err != nil {
switch err.(type) {
case RecipeMissingFromCatalogue:
meta = RecipeMeta{}
default:
return Recipe{}, err
}
}
return Recipe{
Name: recipeName,
Meta: meta,
}, nil
}
func Get2(name string) Recipe2 { func Get2(name string) Recipe2 {
dir := path.Join(config.RECIPES_DIR, name) dir := path.Join(config.RECIPES_DIR, name)
return Recipe2{ return Recipe2{