watchPath adds given path to those watched
(path core.Filename)
| 216 | |
| 217 | // watchPath adds given path to those watched |
| 218 | func (ft *Tree) watchPath(path core.Filename) error { |
| 219 | return nil // TODO: disable for all platforms for now -- getting some issues |
| 220 | if core.TheApp.Platform() == system.MacOS { |
| 221 | return nil // mac is not supported in a high-capacity fashion at this point |
| 222 | } |
| 223 | rp := ft.RelativePathFrom(path) |
| 224 | on, has := ft.watchedPaths[rp] |
| 225 | if on || has { |
| 226 | return nil |
| 227 | } |
| 228 | ft.configWatcher() |
| 229 | // fmt.Printf("watching path: %s\n", path) |
| 230 | err := ft.watcher.Add(string(path)) |
| 231 | if err == nil { |
| 232 | ft.watchedPaths[rp] = true |
| 233 | ft.watchWatcher() |
| 234 | } else { |
| 235 | slog.Error(err.Error()) |
| 236 | } |
| 237 | return err |
| 238 | } |
| 239 | |
| 240 | // unWatchPath removes given path from those watched |
| 241 | func (ft *Tree) unWatchPath(path core.Filename) { |
no test coverage detected