summaryrefslogtreecommitdiff
path: root/recipe.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-04-22 19:28:54 +0200
committerxengineering <me@xengineering.eu>2023-04-22 19:28:54 +0200
commit7bb54a56e993723b2867efbafddd1b9abfebcd9e (patch)
treeaf9225992fe8cd60552a846403d17e5497ac6ba4 /recipe.go
parenta0cc83b88357e73a6bcae156b26029fc5257ac20 (diff)
downloadceres-7bb54a56e993723b2867efbafddd1b9abfebcd9e.tar
ceres-7bb54a56e993723b2867efbafddd1b9abfebcd9e.tar.zst
ceres-7bb54a56e993723b2867efbafddd1b9abfebcd9e.zip
Remove legacy Recipe struct
Diffstat (limited to 'recipe.go')
-rw-r--r--recipe.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/recipe.go b/recipe.go
index 76c5204..a1a27e9 100644
--- a/recipe.go
+++ b/recipe.go
@@ -22,11 +22,20 @@ type recipe struct {
}
}
+func getRecipeText(id string) ([]byte, error) {
+ var b []byte
+ textpath := filepath.Join(config.Data, "recipes", id, "text")
+ b, err := ioutil.ReadFile(textpath)
+ if err != nil {
+ return b, err
+ }
+ return b, nil
+}
+
func getRecipe(id string) (recipe, error) {
r := recipe{}
- textpath := filepath.Join(config.Data, "recipes", id, "text")
- data, err := ioutil.ReadFile(textpath)
+ data, err := getRecipeText(id)
if err != nil {
return r, err
}