handleFileChange loads the PRD and sends an event if it changed.
()
| 126 | |
| 127 | // handleFileChange loads the PRD and sends an event if it changed. |
| 128 | func (w *Watcher) handleFileChange() { |
| 129 | prd, err := LoadPRD(w.path) |
| 130 | if err != nil { |
| 131 | w.events <- WatcherEvent{Error: err} |
| 132 | return |
| 133 | } |
| 134 | |
| 135 | // Check if any story status changed |
| 136 | if w.hasStatusChanged(prd) { |
| 137 | w.lastPRD = prd |
| 138 | w.events <- WatcherEvent{PRD: prd} |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | // hasStatusChanged returns true if any story's inProgress or passes field changed. |
| 143 | func (w *Watcher) hasStatusChanged(newPRD *PRD) bool { |
no test coverage detected