MCPcopy
hub / github.com/go-task/task / registerWatchedDirs

Method registerWatchedDirs

watch.go:165–186  ·  view source on GitHub ↗
(w *fsnotify.Watcher, calls ...*Call)

Source from the content-addressed store, hash-verified

163}
164
165func (e *Executor) registerWatchedDirs(w *fsnotify.Watcher, calls ...*Call) error {
166 files, err := e.collectSources(calls)
167 if err != nil {
168 return err
169 }
170 for _, f := range files {
171 d := filepath.Dir(f)
172 if isSet, ok := e.watchedDirs.Load(d); ok && isSet {
173 continue
174 }
175 if ShouldIgnore(d) {
176 continue
177 }
178 if err := w.Add(d); err != nil {
179 return err
180 }
181 e.watchedDirs.Store(d, true)
182 relPath, _ := filepath.Rel(e.Dir, d)
183 e.Logger.VerboseOutf(logger.Green, "task: watching new dir: %v\n", relPath)
184 }
185 return nil
186}
187
188var ignorePaths = []string{
189 "/.task",

Callers 1

watchTasksMethod · 0.95

Calls 4

collectSourcesMethod · 0.95
ShouldIgnoreFunction · 0.85
VerboseOutfMethod · 0.80
DirMethod · 0.65

Tested by

no test coverage detected