cleaner output

This commit is contained in:
Jeff Carr 2024-12-13 12:56:23 -06:00
parent 9873bc3d57
commit 4a2568fea3
2 changed files with 20 additions and 9 deletions

View File

@ -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))
}
}

View File

@ -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