summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.go26
-rw-r--r--repoClone.go3
2 files changed, 20 insertions, 9 deletions
diff --git a/build.go b/build.go
index ccb32a5..579d738 100644
--- a/build.go
+++ b/build.go
@@ -48,14 +48,17 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
return err
}
- // build the protobuf files in all protobuf repos
- all := repo.GoDeps.SortByGoPath()
- for all.Scan() {
- t := all.Next()
- found := f.Repos.FindByGoPath(t.GetGoPath())
- if found.RepoType() == "protobuf" {
- if err := f.runAutogenpb(found); err != nil {
- return err
+ // if not GoPrimitive, autogen each dependent git repo
+ if repo.GoDepsLen() != 0 {
+ // build the protobuf files in all protobuf repos
+ all := repo.GoDeps.SortByGoPath()
+ for all.Scan() {
+ t := all.Next()
+ found := f.Repos.FindByGoPath(t.GetGoPath())
+ if found.RepoType() == "protobuf" {
+ if err := f.runAutogenpb(found); err != nil {
+ return err
+ }
}
}
}
@@ -66,6 +69,11 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
if repo.CheckDirty() {
version = version + "-dirty"
}
+ if repo.RepoType() == "plugin" {
+ if goWhat == "install" {
+ return errors.New("Can not go install plugins yet")
+ }
+ }
cmd := []string{"go", goWhat}
// if this is a plugin, use buildmode=plugin
@@ -118,7 +126,7 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
log.Info("again failed cmd", strings.Join(cmd, "a"))
log.Info("again failed", strings.Join(res2.Stdout, "\n"))
}
- return errors.New("go build failed: " + fmt.Sprint(result.Error))
+ return errors.New("go " + goWhat + " failed: " + fmt.Sprint(result.Error))
}
}
diff --git a/repoClone.go b/repoClone.go
index 7a51be1..ab1acee 100644
--- a/repoClone.go
+++ b/repoClone.go
@@ -154,6 +154,9 @@ func cloneActual(newdir, basedir, giturl string) (string, error) {
gitdir := filepath.Join(fullpath, ".git")
if IsDirectory(gitdir) {
log.Info("git cloned worked to", fullpath)
+ // also clone notes -- this can store the go.mod and go.sum files
+ cmd := []string{"git", "fetch", "origin", "refs/notes/*:refs/notes/*"}
+ shell.PathRunRealtime(fullpath, cmd)
return giturl, nil
}
// git clone didn't really work but did make a directory