2024-12-05 14:17:50 -06:00
|
|
|
package main
|
|
|
|
|
2024-12-06 01:48:17 -06:00
|
|
|
import (
|
|
|
|
"go.wit.com/lib/protobuf/gitpb"
|
|
|
|
"go.wit.com/log"
|
|
|
|
)
|
2024-12-05 14:17:50 -06:00
|
|
|
|
|
|
|
func doScan() {
|
|
|
|
me.forge.ScanGoSrc()
|
|
|
|
}
|
|
|
|
|
|
|
|
func doGitPull() {
|
2024-12-06 01:48:17 -06:00
|
|
|
allerr := me.found.RillGitPull(40, 5)
|
|
|
|
|
|
|
|
all := me.found.SortByGoPath()
|
|
|
|
for all.Scan() {
|
|
|
|
repo := all.Next()
|
|
|
|
result := allerr[repo]
|
|
|
|
if result.Error == gitpb.ErrorGitPullOnDirty {
|
|
|
|
log.Info("skip git pull. repo is dirty", repo.GoPath)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if result.Error == gitpb.ErrorGitPullOnLocal {
|
|
|
|
log.Info("skip git pull. local branch ", repo.GoPath)
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if result.Exit == 0 {
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
|
|
|
|
log.Info("git pull error:", repo.GoPath, result.Error)
|
|
|
|
log.Info("git pull error:", repo.GoPath, result.Stdout)
|
|
|
|
}
|
|
|
|
|
2024-12-05 14:17:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func doFix() {
|
|
|
|
all := me.found.SortByGoPath()
|
|
|
|
for all.Scan() {
|
|
|
|
repo := all.Next()
|
|
|
|
if !repo.IsValid() {
|
|
|
|
log.Printf("%10s %-50s", "old?\n", repo.GetGoPath())
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
log.Printf("running on: %-50s\n", repo.GetGoPath())
|
|
|
|
cmd := []string{"ls"}
|
|
|
|
repo.Run(cmd)
|
|
|
|
}
|
|
|
|
}
|