diff options
| author | Jeff Carr <[email protected]> | 2024-02-18 10:49:52 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-02-18 10:49:52 -0600 |
| commit | 02542bafe8f570d04a946851a4c993f3f4de6e18 (patch) | |
| tree | 4b3f17953e58b8bd84dff4ea4c089b602c7a1d7f /addRepo.go | |
| parent | 860981e63d535cfed566ac831fc9fd130b1b03fb (diff) | |
add guireleaser view
Diffstat (limited to 'addRepo.go')
| -rw-r--r-- | addRepo.go | 141 |
1 files changed, 89 insertions, 52 deletions
@@ -75,64 +75,101 @@ func (r *RepoList) addRepo(grid *gui.Node, path string, master string, devel str newRepo.pLabel = grid.NewLabel(path).SetProgName("path") newRepo.lastTag = grid.NewLabel("").SetProgName("lastTag") newRepo.masterVersion = grid.NewLabel("").SetProgName("masterVersion") - newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion") - newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion") - newRepo.dirtyLabel = grid.NewLabel("") - newRepo.vLabel = grid.NewLabel("").SetProgName("current") - newRepo.endBox = grid.NewHorizontalBox("HBOX") - newRepo.endBox.NewButton("Configure", func() { - if newRepo.Status == nil { - // this should never happen, but it does happen because I'm not that smart and forget I can nil Status - // for some reason that makes sense in my head. again, I'm not that smart - log.Warn("status window wasn't created") - return - } - newRepo.Status.Toggle() - }) + newRepo.hidden = false + switch r.viewName { + case "autotypist": + newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion") + newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion") + newRepo.dirtyLabel = grid.NewLabel("") + newRepo.vLabel = grid.NewLabel("").SetProgName("current") + newRepo.endBox = grid.NewHorizontalBox("HBOX") + newRepo.endBox.NewButton("Configure", func() { + if newRepo.Status == nil { + // this should never happen, but it does happen because I'm not that smart and forget I can nil Status + // for some reason that makes sense in my head. again, I'm not that smart + log.Warn("status window wasn't created") + return + } + newRepo.Status.Toggle() + }) - newRepo.endBox.NewButton("show diff", func() { - r.reposbox.Disable() - // newRepo.Status.XtermNohup([]string{"git diff"}) - newRepo.Status.Xterm("git diff; bash") - r.reposbox.Enable() - }) + newRepo.endBox.NewButton("show diff", func() { + r.reposbox.Disable() + // newRepo.Status.XtermNohup([]string{"git diff"}) + newRepo.Status.Xterm("git diff; bash") + r.reposbox.Enable() + }) - newRepo.endBox.NewButton("commit all", func() { - r.reposbox.Disable() - // restore anything staged so everything can be reviewed - newRepo.Status.RunCmd([]string{"git", "restore", "--staged", "."}) - newRepo.Status.XtermWait("git diff") - newRepo.Status.XtermWait("git add --all") - newRepo.Status.XtermWait("git commit -a") - newRepo.Status.XtermWait("git push") - if newRepo.Status.CheckDirty() { - // commit was not done, restore diff + newRepo.endBox.NewButton("commit all", func() { + r.reposbox.Disable() + // restore anything staged so everything can be reviewed newRepo.Status.RunCmd([]string{"git", "restore", "--staged", "."}) - } else { - newRepo.NewScan() - } - r.reposbox.Enable() - }) + newRepo.Status.XtermWait("git diff") + newRepo.Status.XtermWait("git add --all") + newRepo.Status.XtermWait("git commit -a") + newRepo.Status.XtermWait("git push") + if newRepo.Status.CheckDirty() { + // commit was not done, restore diff + newRepo.Status.RunCmd([]string{"git", "restore", "--staged", "."}) + } else { + newRepo.NewScan() + } + r.reposbox.Enable() + }) - newRepo.hidden = false - // newRepo.Status.SetMainWorkingName(master) - // newRepo.Status.SetDevelWorkingName(devel) - // newRepo.Status.SetUserWorkingName(user) + // newRepo.Status.SetMainWorkingName(master) + // newRepo.Status.SetDevelWorkingName(devel) + // newRepo.Status.SetUserWorkingName(user) - var showBuildB bool = false - switch newRepo.Status.RepoType() { - case "binary": - // log.Info("compile here. Show()") - showBuildB = true - case "library": - // log.Info("library here. Hide()") - default: - // log.Info("unknown RepoType", newRepo.Status.RepoType()) - } - if showBuildB { - newRepo.endBox.NewButton("build", func() { - newRepo.Status.Build() + var showBuildB bool = false + switch newRepo.Status.RepoType() { + case "binary": + // log.Info("compile here. Show()") + showBuildB = true + case "library": + // log.Info("library here. Hide()") + default: + // log.Info("unknown RepoType", newRepo.Status.RepoType()) + } + if showBuildB { + newRepo.endBox.NewButton("build", func() { + newRepo.Status.Build() + }) + } + newRepo.goSumStatus = r.blind.NewLabel("in the blind") + case "guireleaser": + newRepo.develVersion = grid.NewLabel("").SetProgName("develVersion") + newRepo.userVersion = grid.NewLabel("").SetProgName("userVersion") + newRepo.dirtyLabel = grid.NewLabel("") + newRepo.vLabel = grid.NewLabel("").SetProgName("current") + newRepo.endBox = grid.NewHorizontalBox("HBOX") + newRepo.endBox.NewButton("Configure", func() { + if newRepo.Status == nil { + // this should never happen, but it does happen because I'm not that smart and forget I can nil Status + // for some reason that makes sense in my head. again, I'm not that smart + log.Warn("status window wasn't created") + return + } + newRepo.Status.Toggle() }) + + var showBuildB bool = false + switch newRepo.Status.RepoType() { + case "binary": + // log.Info("compile here. Show()") + showBuildB = true + case "library": + // log.Info("library here. Hide()") + default: + // log.Info("unknown RepoType", newRepo.Status.RepoType()) + } + if showBuildB { + newRepo.endBox.NewButton("build", func() { + newRepo.Status.Build() + }) + } + newRepo.goSumStatus = r.blind.NewLabel("in the blind") + default: } grid.NextRow() |
