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,6 +48,8 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
return err return err
} }
// if not GoPrimitive, autogen each dependent git repo
if repo.GoDepsLen() != 0 {
// build the protobuf files in all protobuf repos // build the protobuf files in all protobuf repos
all := repo.GoDeps.SortByGoPath() all := repo.GoDeps.SortByGoPath()
for all.Scan() { for all.Scan() {
@ -59,6 +61,7 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
} }
} }
} }
}
// get the version // get the version
version := repo.GetCurrentBranchVersion() version := repo.GetCurrentBranchVersion()
@ -66,6 +69,11 @@ func (f *Forge) doBuild(repo *gitpb.Repo, userFlags []string, goWhat string) err
if repo.CheckDirty() { if repo.CheckDirty() {
version = version + "-dirty" version = version + "-dirty"
} }
if repo.RepoType() == "plugin" {
if goWhat == "install" {
return errors.New("Can not go install plugins yet")
}
}
cmd := []string{"go", goWhat} cmd := []string{"go", goWhat}
// if this is a plugin, use buildmode=plugin // 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 cmd", strings.Join(cmd, "a"))
log.Info("again failed", strings.Join(res2.Stdout, "\n")) 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") gitdir := filepath.Join(fullpath, ".git")
if IsDirectory(gitdir) { if IsDirectory(gitdir) {
log.Info("git cloned worked to", fullpath) 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 return giturl, nil
} }
// git clone didn't really work but did make a directory // git clone didn't really work but did make a directory