diff options
Diffstat (limited to 'scan.go')
| -rw-r--r-- | scan.go | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -19,10 +19,12 @@ func (r *RepoList) RegisterHideFunction(f func(*RepoRow)) { func (r *RepoList) ScanRepositories() (int, string) { var i int var shown int + var total int t := TimeFunction(func() { for _, repo := range me.allrepos { i += 1 - repo.NewScan() + changed := repo.NewScan() + total += changed if me.hideFunction == nil { // application didn't register a hide function } else { @@ -44,14 +46,15 @@ func (r *RepoList) ScanRepositories() (int, string) { me.shownCount.SetText(tmp) me.duration.SetText(s) - log.Info("Scanned", i, "repositories. todo: count/show changes in", s) + log.Info("Scanned", i, "repositories.", total, "changes in", s) return i, s } -func (r *RepoRow) NewScan() bool { +func (r *RepoRow) NewScan() int { + var changed int = 0 if r.Status == nil { log.Warn("repo.Status = nil. not initialized for some reason") - return false + return changed } // run the repostatus update @@ -62,6 +65,7 @@ func (r *RepoRow) NewScan() bool { c := strings.TrimSpace(c) for _, line := range strings.Split(c, "\n") { log.Info(r.Status.Path(), line) + changed += 1 } } @@ -73,5 +77,5 @@ func (r *RepoRow) NewScan() bool { r.Show() } } - return true + return changed } |
