refator(recipe): remove old struct
This commit is contained in:
parent
5617a9ba07
commit
f638b6a16b
@ -122,35 +122,6 @@ type Features struct {
|
||||
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 {
|
||||
dir := path.Join(config.RECIPES_DIR, name)
|
||||
return Recipe2{
|
||||
|
Loading…
x
Reference in New Issue
Block a user