Compare commits

..

No commits in common. "master" and "v0.7.87" have entirely different histories.

3 changed files with 12 additions and 12 deletions

View File

@ -68,7 +68,7 @@ func clone(gopath string) (*gitpb.Repo, error) {
gopath = CleanRepoURL(gopath)
os.Setenv("REPO_AUTO_CLONE", "true")
// pb, _ := forge.NewGoPath(gopath)
check := forge.FindAnyPath(filepath.Join(forge.Config.ReposDir, gopath))
check := forge.FindAnyPath(filepath.Join(forge.GetGoSrc(), gopath))
if check != nil {
if check.IsValidDir() {
// repo already exists and is valid
@ -103,28 +103,28 @@ func recursiveClone(check *gitpb.Repo) error {
if check == nil {
return errors.New("repo was nil")
}
log.Info("STARTING RECURSIVE CLONE", check.Namespace)
log.Info("STARTING RECURSIVE CLONE", check.Namespace)
log.Info("STARTING RECURSIVE CLONE", check.GetGoPath())
log.Info("STARTING RECURSIVE CLONE", check.GetGoPath())
// if just cloned, parse the go.sum file for deps
if check.ParseGoSum() {
} else {
makeValidGoSum(check)
}
check.ReloadForce()
check.Reload()
if check.GoDeps == nil {
log.Info("repo godeps == nil", check.Namespace)
log.Info("repo godeps == nil", check.GetGoPath())
return errors.New("no go deps?")
}
// probably this should never be 0 because GoPrimitive should have been true otherwise
if check.GoDeps.Len() == 0 {
log.Info("repo len(godeps) == 0", check.Namespace)
log.Info("repo len(godeps) == 0", check.GetGoPath())
return errors.New("go.sum never parsed?")
}
log.Info("deps for", check.Namespace, "len()", check.GoDeps.Len())
log.Info("deps for", check.GetGoPath(), "len()", check.GoDeps.Len())
deps := check.GoDeps.SortByGoPath()
for deps.Scan() {
depRepo := deps.Next()
@ -179,7 +179,7 @@ func makeValidGoSum(check *gitpb.Repo) error {
// if this fails, just use go mod
if err := check.ValidGoSum(); err != nil {
cmd := []string{"go", "mod", "init", check.Namespace}
cmd := []string{"go", "mod", "init", check.GetGoPath()}
log.Info("try running", cmd)
if _, err := check.RunQuiet(cmd); err != nil {
log.Info("go mod init failed", err)

View File

@ -86,6 +86,6 @@ func okExit(thing string) {
func badExit(err error) {
log.Info("Total repositories:", forge.Repos.Len())
log.Info("Finished go-clone with error", err, forge.Config.ReposDir)
log.Info("Finished go-clone with error", err, forge.GetGoSrc())
os.Exit(-1)
}

View File

@ -10,10 +10,10 @@ func autoWork() {
if !argv.AutoWork {
return
}
log.Info("About to re-create", forge.Config.ReposDir+"/go.work")
shell.PathRun(forge.Config.ReposDir, []string{"mv", "go.work", "go.work.last"})
log.Info("About to re-create", forge.GetGoSrc()+"/go.work")
shell.PathRun(forge.GetGoSrc(), []string{"mv", "go.work", "go.work.last"})
forge.MakeGoWork()
shell.PathRun(forge.Config.ReposDir, []string{"go", "work", "use"})
shell.PathRun(forge.GetGoSrc(), []string{"go", "work", "use"})
log.Info("")
log.Info("original go.work file saved as go.work.last")
log.Info("")