NewProgressWatcher creates a new watcher for progress.md in the same directory as the given prd.json path.
(prdPath string)
| 98 | // NewProgressWatcher creates a new watcher for progress.md in the same |
| 99 | // directory as the given prd.json path. |
| 100 | func NewProgressWatcher(prdPath string) (*ProgressWatcher, error) { |
| 101 | dir := filepath.Dir(prdPath) |
| 102 | fsWatcher, err := fsnotify.NewWatcher() |
| 103 | if err != nil { |
| 104 | return nil, err |
| 105 | } |
| 106 | return &ProgressWatcher{ |
| 107 | dir: dir, |
| 108 | watcher: fsWatcher, |
| 109 | events: make(chan map[string][]ProgressEntry, 10), |
| 110 | done: make(chan struct{}), |
| 111 | }, nil |
| 112 | } |
| 113 | |
| 114 | // Start begins watching for progress.md changes. |
| 115 | func (w *ProgressWatcher) Start() error { |
no outgoing calls
no test coverage detected