Skip to content

Commit

Permalink
fix again
Browse files Browse the repository at this point in the history
  • Loading branch information
schollz committed Nov 20, 2022
1 parent 1a2af7a commit 478befb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

wordwrap "github.com/mitchellh/go-wordwrap"
meanrecipe "github.com/schollz/meanrecipe/src"
meanrecipe "github.com/schollz/meanrecipe/v2/src"
"gopkg.in/AlecAivazis/survey.v1"
)

Expand Down
11 changes: 8 additions & 3 deletions src/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,14 @@ func Run(recipe string, clusters int, requiredIngredients []string, determineReq
}
}
if len(requiredIngredients) > 0 {
requiredIngredients = googleit.ListToSet(requiredIngredients)
for i := range requiredIngredients {
requiredIngredients[i] = Singularlize(requiredIngredients[i])
requiredIngredients = []string{}
ring := googleit.ListToSet(requiredIngredients)
for _,ing := range ring {
ing = Singularlize(ing)
ing = strings.TrimSpace(ing)
if len(ing)>2 {
requiredIngredients=append(requiredIngredients,ing)
}
}
log.Infof("requiring %d ingredients: %+v", len(requiredIngredients), requiredIngredients)
}
Expand Down

0 comments on commit 478befb

Please sign in to comment.