diff options
| author | Jeff Carr <[email protected]> | 2024-12-17 01:15:17 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-17 01:15:17 -0600 |
| commit | b2e51ccb9efc326fda8615b1d2ad9f2ea3f16652 (patch) | |
| tree | 2c754b6fa07b76d4676498dd5de5bf75b2b509a6 /init.go | |
| parent | 1369d2df3168426e450dd07314dcaf82dccf232c (diff) | |
improve Init()
Diffstat (limited to 'init.go')
| -rw-r--r-- | init.go | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -34,25 +34,34 @@ func Init() *Forge { log.Info("forgepb.Scan() Scan found", end-start, "new git repositories.") } - if f.updateAll() { + f.updateAll() + + if f.configSave { f.ConfigSave() + f.configSave = false } log.Info("update() check took", shell.FormatDuration(time.Since(now))) return f } -func (f *Forge) updateAll() bool { - var configSave bool +func (f *Forge) updateAll() { all := f.Repos.SortByFullPath() for all.Scan() { repo := all.Next() + if !repo.IsValidDir() { + log.Printf("%10s %-50s", "old?\n", repo.GoPath) + f.Repos.DeleteByGoPath(repo.GoPath) + f.configSave = true + continue + } + if repo.RepoChanged() { - configSave = true + f.configSave = true log.Info("repo changed", repo.StateChange, repo.FullPath) + repo.Reload() } } - return configSave } // only init's the protobuf. intended to not scan or change anything |
