summaryrefslogtreecommitdiff
path: root/clone.go
diff options
context:
space:
mode:
Diffstat (limited to 'clone.go')
-rw-r--r--clone.go36
1 files changed, 18 insertions, 18 deletions
diff --git a/clone.go b/clone.go
index d821f63..86a2bdc 100644
--- a/clone.go
+++ b/clone.go
@@ -20,7 +20,7 @@ func clone(gopath string) (*gitpb.Repo, error) {
}
os.Setenv("REPO_AUTO_CLONE", "true")
// pb, _ := forge.NewGoPath(gopath)
- check := forge.Repos.FindByGoPath(gopath)
+ check := forge.Repos.FindByFullPath(gopath)
if check != nil {
if check.IsValidDir() {
// repo already exists and is valid
@@ -60,10 +60,10 @@ func recursiveClone(check *gitpb.Repo) error {
if check == nil {
return errors.New("repo was nil")
}
- log.Info("STARTING RECURSIVE CLONE", check.GoPath)
- log.Info("STARTING RECURSIVE CLONE", check.GoPath)
- if check.GoPrimitive {
- log.Info("repo is a primitive", check.GoPath)
+ log.Info("STARTING RECURSIVE CLONE", check.GetGoPath())
+ log.Info("STARTING RECURSIVE CLONE", check.GetGoPath())
+ if check.GoInfo.GoPrimitive {
+ log.Info("repo is a primitive", check.GetGoPath())
// go primitive repos are "pure"
return nil
}
@@ -72,29 +72,29 @@ func recursiveClone(check *gitpb.Repo) error {
check.ParseGoSum()
if check.GoDeps == nil {
- log.Info("repo godeps == nil", check.GoPath)
+ log.Info("repo godeps == nil", check.GetGoPath())
return errors.New("go.sum is missing?")
}
// 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.GoPath)
+ log.Info("repo len(godeps) == 0", check.GetGoPath())
return errors.New("go.sum never parsed?")
}
- log.Info("deps for", check.GoPath, "len()", check.GoDeps.Len())
+ log.Info("deps for", check.GetGoPath(), "len()", check.GoDeps.Len())
deps := check.GoDeps.SortByGoPath()
for deps.Scan() {
depRepo := deps.Next()
- log.Info("download:", depRepo.GoPath)
- _, err := clone(depRepo.GoPath)
+ log.Info("download:", depRepo.GetGoPath())
+ _, err := clone(depRepo.GetGoPath())
if err != nil {
- log.Info("recursiveClone() could not download", depRepo.GoPath)
+ log.Info("recursiveClone() could not download", depRepo.GetGoPath())
log.Info("err:", err)
bad += 1
- badmap[depRepo.GoPath] = err
+ badmap[depRepo.GetGoPath()] = err
} else {
- log.Info("downloaded", depRepo.GoPath)
+ log.Info("downloaded", depRepo.GetGoPath())
good += 1
}
}
@@ -119,8 +119,8 @@ func makeValidGoSum(check *gitpb.Repo) error {
return err
}
}
- if check.GoPrimitive {
- log.Info(check.GoPath, "is a golang primitive! no need to parse go.sum because there is not one!")
+ if check.GoInfo.GoPrimitive {
+ log.Info(check.GetGoPath(), "is a golang primitive! no need to parse go.sum because there is not one!")
return nil
}
// attempt to grab the notes
@@ -139,7 +139,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.GoPath}
+ cmd := []string{"go", "mod", "init", check.GetGoPath()}
log.Info("try running", cmd)
if err := check.RunStrict(cmd); err != nil {
log.Info("go mod init failed", err)
@@ -149,8 +149,8 @@ func makeValidGoSum(check *gitpb.Repo) error {
return err
}
}
- if check.GoPrimitive {
- log.Info(check.GoPath, "is a golang primitive! no need to parse go.sum because there is not one!")
+ if check.GoInfo.GoPrimitive {
+ log.Info(check.GetGoPath(), "is a golang primitive! no need to parse go.sum because there is not one!")
return nil
}
if err := check.RunStrict([]string{"go", "mod", "tidy"}); err != nil {