| 108 | } |
| 109 | |
| 110 | func (e *Executor) setupFuzzyModel() { |
| 111 | if e.Taskfile == nil { |
| 112 | return |
| 113 | } |
| 114 | |
| 115 | model := fuzzy.NewModel() |
| 116 | model.SetThreshold(1) // because we want to build grammar based on every task name |
| 117 | |
| 118 | var words []string |
| 119 | for name, task := range e.Taskfile.Tasks.All(nil) { |
| 120 | if task.Internal { |
| 121 | continue |
| 122 | } |
| 123 | words = append(words, name) |
| 124 | words = slices.Concat(words, task.Aliases) |
| 125 | } |
| 126 | |
| 127 | model.Train(words) |
| 128 | e.fuzzyModel = model |
| 129 | } |
| 130 | |
| 131 | func (e *Executor) setupTempDir() error { |
| 132 | if e.TempDir != (TempDir{}) { |