rill is fantastic

This commit is contained in:
Jeff Carr 2024-12-03 13:23:35 -06:00
parent 8e29098aa8
commit a3a54501f6
1 changed files with 24 additions and 18 deletions

44
main.go
View File

@ -47,6 +47,9 @@ func main() {
log.Info("yep, need to clone", argv.Repo) log.Info("yep, need to clone", argv.Repo)
} else { } else {
log.Info("already have", argv.Repo) log.Info("already have", argv.Repo)
if argv.Recursive {
recursiveClone()
}
build() build()
okExit(argv.Repo) okExit(argv.Repo)
} }
@ -173,32 +176,35 @@ func gitPull() {
log.Info("Total repositories:", forge.Repos.Len(), "Total attempted:", trycount, "Errors:", errcount) log.Info("Total repositories:", forge.Repos.Len(), "Total attempted:", trycount, "Errors:", errcount)
} }
// really only does go.sum things
// so not 'really' recursive
// but that is because go.sum is supposed
// to have everything required in it
func recursiveClone() { func recursiveClone() {
var good int
var bad int
// this works sometimes // this works sometimes
if argv.Recursive { if argv.Recursive {
newr := rv.FindByName(argv.Repo) check := forge.Repos.FindByGoPath(argv.Repo)
if newr == nil {
log.Info("how did this repo still not exist?", argv.Repo) log.Info("download deps for:", check.GoPath)
badExit(errors.New("failed to clone repo: " + argv.Repo)) deps := check.GoDeps.SortByGoPath()
} for deps.Scan() {
os.Setenv("REPO_AUTO_CLONE", "true") depRepo := deps.Next()
godep := newr.Status.GetGoDeps() log.Info("download:", depRepo.GoPath)
for gopath, version := range godep { _, err := forge.Clone(depRepo.GoPath)
pb, err := forge.Clone(gopath)
if err != nil { if err != nil {
log.Info("could not download") log.Info("could not download", depRepo.GoPath)
badExit(err) log.Info("err:", err)
} bad += 1
repo, err := rv.AddRepo(pb) } else {
if err != nil { log.Info("downloaded", depRepo.GoPath)
log.Info("git clone failed for", gopath, version) good += 1
continue
}
// always do this for now. probably always forever
repo.MakeRedoMod()
} }
} }
} }
log.Info("got", good, "repos", "failed on", bad, "repos")
}
func redoGoModAll() { func redoGoModAll() {
loop := rv.ReposSortByName() loop := rv.ReposSortByName()