Skip to content

Commit

Permalink
Keep recipes with just YAML files
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhs committed Jan 15, 2022
1 parent 5df4f74 commit 026f766
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Bleve.go
Expand Up @@ -176,8 +176,10 @@ func (b Bleve) Search(query string) (Results, error) {
i := 0
for _, recipe := range results.Recipes {
if _, err := os.Stat(Config.KnowledgeDirectory + string(recipe.Id) + ".md"); os.IsNotExist(err) {
RemoveFromIndex(recipe.Id)
continue
if _, err = os.Stat(Config.KnowledgeDirectory + string(recipe.Id) + ".yaml"); os.IsNotExist(err) {
RemoveFromIndex(recipe.Id)
continue
}
}
recipes[i] = recipe
i += 1
Expand Down

0 comments on commit 026f766

Please sign in to comment.