diff options
| author | Jeff Carr <[email protected]> | 2025-10-03 22:02:38 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-03 22:02:38 -0500 |
| commit | 21f674cc5d222ca3fde330d5f14e556555fff183 (patch) | |
| tree | dc1dab65cd714f9d825df5c5a0d8b2c06a8cccdc | |
| parent | 1a0a7d2b8f9e5677af3f244c192b304eeadad776 (diff) | |
show tags
| -rw-r--r-- | argv.go | 1 | ||||
| -rw-r--r-- | doBuild.go | 1 | ||||
| -rw-r--r-- | doDebian.go | 25 | ||||
| -rw-r--r-- | doGit.go | 76 |
4 files changed, 67 insertions, 36 deletions
@@ -73,6 +73,7 @@ type DefaultCmd struct { type GitCmd struct { Log *EmptyCmd `arg:"subcommand:log" help:"git log"` Who *EmptyCmd `arg:"subcommand:who" help:"git who"` + Tag *EmptyCmd `arg:"subcommand:tag" help:"show tags"` Pull *EmptyCmd `arg:"subcommand:pull" help:"pull the wit standard paths"` Push *EmptyCmd `arg:"subcommand:push" help:"push the wit standard paths"` } @@ -188,5 +188,6 @@ func doInstall() error { log.Info("CRAP. INSTALL FAILED", shell.FormatDuration(dur), s, stat.Err) badExit(stat.Err) } + os.Remove(filepath.Join(me.homedir, "go/bin/forged")) return nil } diff --git a/doDebian.go b/doDebian.go index 0a2617a..60b0600 100644 --- a/doDebian.go +++ b/doDebian.go @@ -44,7 +44,23 @@ func doDebian() { } found.Append(check) } - me.forge.PrintForgedTable(found) + + tablePB := me.forge.GetBuildBaseTB(found) + log.Info("TABLE FUNC LEN=", len(tablePB.Funcs)) + col := tablePB.AddStringFunc("a", func(r *gitpb.Repo) string { + debname := me.forge.Config.DebName(r.GetNamespace()) + if actualp := me.machine.FindInstalledByName(debname); actualp != nil { + return "b" + } + return "c" + }) + col.Width = 6 + log.Info("TABLE FUNC LEN=", len(tablePB.Funcs)) + tablePB.PrintTable() + + // func (f *Forge) isInstalled(repo *gitpb.Repo) string { + // return "X" + // } if !argv.DryRun { me.forge.ConfigRill(16, 16) @@ -82,12 +98,12 @@ func buildDeb(check *gitpb.Repo) error { os.MkdirAll(outdir, 0755) if argv.Build.Debian.Release { - cmd = []string{"go-deb", "--release", "--dir", outdir} + cmd = []string{"go-deb", "--release", "--namespace", check.Namespace, "--dir", outdir} } else { - cmd = []string{"go-deb", "--dir", outdir} + cmd = []string{"go-deb", "--namespace", check.Namespace, "--dir", outdir} } if me.forge.Config.IsPrivate(check.GetNamespace()) { - cmd = []string{"go-deb", "--dir", outdir} + cmd = []string{"go-deb", "--namespace", check.Namespace, "--dir", outdir} return nil } @@ -105,6 +121,7 @@ func buildDeb(check *gitpb.Repo) error { cmd = append(cmd, "--verbose") } if argv.DryRun { + log.Info("RUN:", check.FullPath, cmd) return nil } @@ -6,12 +6,56 @@ package main import ( "os" "path/filepath" + "strings" "go.wit.com/lib/gui/shell" "go.wit.com/lib/protobuf/gitpb" "go.wit.com/log" ) +func doGit() error { + log.DaemonMode(true) + defer log.DaemonMode(false) + + if argv.Git.Log != nil { + fstr := "--format=\"%h %>(24)%ar %>(20)%an %s" + cmd := []string{"git", "log", fstr} + shell.RunVerbose(cmd) + okExit("") + } + + if argv.Git.Tag != nil { + cmd := []string{"git", "for-each-ref", "--sort=taggerdate", "--format"} + cmd = append(cmd, "%(tag)%00%(taggerdate:raw)%00%(taggername)%00%(subject)") + cmd = append(cmd, "refs/tags") + result := shell.RunQuiet(cmd) + for i, line := range result.Stdout { + parts := strings.Split(line, "\x00") + log.Infof("LINE: %d %v\n", i, parts) + } + } + + if argv.Git.Who != nil { + cmd := []string{"git", "who"} + shell.RunVerbose(cmd) + okExit("") + } + + if argv.Git.Pull != nil { + doPull(".config/wit") + doPull("tools") + okExit("") + } + + if argv.Git.Push != nil { + doPush(".config/wit") + doPush("tools") + okExit("") + } + + return nil +} + func findRepo(wpath string) (*gitpb.Repo, bool) { d := filepath.Join(me.homedir, wpath) if !shell.IsDir(d) { @@ -56,35 +100,3 @@ func doPush(wpath string) { repo.RunRealtime([]string{"git", "push"}) } - -func doGit() error { - log.DaemonMode(true) - defer log.DaemonMode(false) - - if argv.Git.Log != nil { - fstr := "--format=\"%h %>(24)%ar %>(20)%an %s" - cmd := []string{"git", "log", fstr} - shell.RunVerbose(cmd) - okExit("") - } - - if argv.Git.Who != nil { - cmd := []string{"git", "who"} - shell.RunVerbose(cmd) - okExit("") - } - - if argv.Git.Pull != nil { - doPull(".config/wit") - doPull("tools") - okExit("") - } - - if argv.Git.Push != nil { - doPush(".config/wit") - doPush("tools") - okExit("") - } - - return nil -} |
