refactor(recipe): don't use README.md path directly

This commit is contained in:
2024-07-08 11:29:20 +02:00
parent c861c09cce
commit 6f90fc3025
4 changed files with 16 additions and 17 deletions

View File

@ -57,6 +57,7 @@ keys configured on your account.
BashComplete: autocomplete.RecipeNameComplete,
Action: func(c *cli.Context) error {
recipeName := c.Args().First()
r := recipe.Get2(recipeName)
if recipeName != "" {
internal.ValidateRecipe(c)
@ -103,7 +104,7 @@ keys configured on your account.
log.Warn(err)
}
features, category, err := recipe.GetRecipeFeaturesAndCategory(recipeMeta.Name)
features, category, err := recipe.GetRecipeFeaturesAndCategory(r)
if err != nil {
log.Warn(err)
}

View File

@ -80,11 +80,7 @@ recipe and domain in the sample environment config).
meta := newRecipeMeta(recipeName)
toParse := []string{
path.Join(config.RECIPES_DIR, recipeName, "README.md"),
r.SampleEnvPath,
}
for _, path := range toParse {
for _, path := range []string{r.ReadmePath, r.SampleEnvPath} {
tpl, err := template.ParseFiles(path)
if err != nil {
log.Fatal(err)