diff options
| author | Jeff Carr <[email protected]> | 2024-12-15 08:45:44 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-15 08:45:44 -0600 |
| commit | b3bfa8915c1cc39bb36094829273d43621eb39ee (patch) | |
| tree | 4538664a91c049e4f523a4e9ec44cf7fe3062795 /gitPull.go | |
| parent | 7cade75da86c346cd39ee37e85c066347cdaf274 (diff) | |
lots more code cleanups
Diffstat (limited to 'gitPull.go')
| -rw-r--r-- | gitPull.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gitPull.go b/gitPull.go new file mode 100644 index 0000000..aaee913 --- /dev/null +++ b/gitPull.go @@ -0,0 +1,30 @@ +package main + +import ( + "go.wit.com/lib/gui/shell" + "go.wit.com/log" +) + +func gitPull() { + log.Info("Total repositories:", forge.Repos.Len()) + log.Info("Going to run git pull in each one. TODO: use rill here") + pull := []string{"git", "pull"} + + var trycount, errcount int + repos := forge.Repos.SortByGoPath() + for repos.Scan() { + repo := repos.Next() + if argv.DryRun { + log.Info("git pull --dry-run", repo.GoPath) + continue + } + log.Info("git pull:", repo.FullPath) + trycount += 1 + log.Info("actually run: git pull:", repo.GoPath) + if result := shell.PathRunRealtime(repo.FullPath, pull); result.Error != nil { + log.Info("git pull error:", result.Error) + errcount += 1 + } + } + log.Info("Total repositories:", forge.Repos.Len(), "Total attempted:", trycount, "Errors:", errcount) +} |
