rm old code
This commit is contained in:
parent
92d5f6b92c
commit
e4a8fa53a7
|
@ -1,7 +1,6 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strconv"
|
||||
|
@ -17,8 +16,8 @@ func globalResetOptions(box *gui.Node) {
|
|||
grid := group2.RawGrid()
|
||||
|
||||
grid.NewButton("remake 'go.work' file", func() {
|
||||
me.autotypistWindow.Disable()
|
||||
|
||||
me.repos.View.MakeGoWork()
|
||||
/*
|
||||
goSrcDir := me.goSrcPwd.String()
|
||||
filename := filepath.Join(goSrcDir, "go.work")
|
||||
|
||||
|
@ -36,13 +35,12 @@ func globalResetOptions(box *gui.Node) {
|
|||
if repo.Status.Exists("go.mod") {
|
||||
fmt.Fprintln(f, "\t"+repo.Status.GoPath())
|
||||
} else {
|
||||
log.Info("missing go.mod for", repo.Status.Path())
|
||||
log.Info("missing go.mod for", repo.Status.GoPath())
|
||||
// repo.Status.MakeRedomod()
|
||||
}
|
||||
}
|
||||
fmt.Fprintln(f, ")")
|
||||
|
||||
me.autotypistWindow.Enable()
|
||||
*/
|
||||
})
|
||||
grid.NextRow()
|
||||
|
||||
|
@ -136,7 +134,7 @@ func globalResetOptions(box *gui.Node) {
|
|||
me.deleteGoSrcPkgB.SetLabel("WE ARE NOT KIDDING")
|
||||
return
|
||||
}
|
||||
var totals string = "All " + strconv.Itoa(me.repos.View.TotalGo()) + " Repos?"
|
||||
var totals string = "All " + strconv.Itoa(me.forge.Repos.Len()) + " Repos?"
|
||||
log.Info("totals =", totals)
|
||||
if me.deleteGoSrcPkgB.String() == "WE ARE NOT KIDDING" {
|
||||
me.deleteGoSrcPkgB.SetLabel(totals)
|
||||
|
|
66
http.go
66
http.go
|
@ -7,7 +7,6 @@ import (
|
|||
"strings"
|
||||
|
||||
"go.wit.com/lib/gui/repostatus"
|
||||
"go.wit.com/lib/gui/shell"
|
||||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
|
@ -53,40 +52,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
if route == "/gitpull" {
|
||||
repoName := r.URL.Query().Get("repo")
|
||||
if repoName != "" {
|
||||
// git pull (or go-clone of it doesn't exist)
|
||||
repo := me.repos.View.FindByName(repoName)
|
||||
if repo == nil {
|
||||
cmd := []string{"go-clone", repoName}
|
||||
header := repo.StandardHeader()
|
||||
log.Info(header + strings.Join(cmd, " "))
|
||||
shell.RunHttpOut(cmd, w, r)
|
||||
} else {
|
||||
cmd := []string{"git", "pull", "-v"}
|
||||
header := repo.StandardHeader()
|
||||
log.Info(header + strings.Join(cmd, " "))
|
||||
shell.RunPathHttpOut(repo.Status.FullPath(), cmd, w, r)
|
||||
}
|
||||
return
|
||||
}
|
||||
// git pull every repo. Ignore Dirty repos
|
||||
loop := me.repos.View.ReposAll()
|
||||
for loop.Scan() {
|
||||
repo := loop.Repo()
|
||||
cmd := []string{"git", "pull", "-v"}
|
||||
header := repo.StandardHeader()
|
||||
if repo.CheckDirty() {
|
||||
log.Info(header + "skip dirty repo")
|
||||
continue
|
||||
}
|
||||
log.Info(header + strings.Join(cmd, " "))
|
||||
shell.RunPathHttpOut(repo.Status.FullPath(), cmd, w, r)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
if route == "/list" {
|
||||
readonly := r.URL.Query().Get("readonly")
|
||||
onlydirty := r.URL.Query().Get("onlydirty")
|
||||
|
@ -130,37 +95,6 @@ func okHandler(w http.ResponseWriter, r *http.Request) {
|
|||
log.Info(fmt.Sprintf("EVERYTHING WORKED repo count = %d", count))
|
||||
return
|
||||
}
|
||||
if route == "/goweblist" {
|
||||
readonly := r.URL.Query().Get("readonly")
|
||||
loop := me.repos.View.ReposAll()
|
||||
for loop.Scan() {
|
||||
repo := loop.Repo()
|
||||
lastTag := repo.LastTag()
|
||||
tag := repo.Status.NewestTag()
|
||||
gitAge, err := tag.GetDate()
|
||||
if err != nil {
|
||||
log.Info(fmt.Sprintf("tag date error", repo.Name()))
|
||||
}
|
||||
// if lastTag == "" {
|
||||
// lastTag = tag.Name()
|
||||
// }
|
||||
if repo.ReadOnly() {
|
||||
if readonly == "true" {
|
||||
continue
|
||||
}
|
||||
}
|
||||
// dur := time.Since(gitAge)
|
||||
// log.Info(fmt.Sprintf("%-60s %s %s %s", repo.Name(), lastTag, shell.FormatDuration(dur), lastTag, tag.Name()))
|
||||
fmt.Fprintf(w, "%s %d %s\n", repo.Name(), gitAge.Unix(), lastTag)
|
||||
/*
|
||||
for _, tag := range repo.Tags.ListAll() {
|
||||
log.Info(fmt.Sprintf("%-60s %s", "", tag.Name()))
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// turn off timestamps for STDOUT (systemd adds them)
|
||||
if route == "/daemon" {
|
||||
|
|
43
tagWindow.go
43
tagWindow.go
|
@ -44,50 +44,9 @@ func makeTagWindow() *tagWindow {
|
|||
tagW.grid = tagW.box.RawGrid()
|
||||
|
||||
topGrid.NewButton("list all tags", func() {
|
||||
me.autotypistWindow.Disable()
|
||||
defer me.autotypistWindow.Enable()
|
||||
loop := me.repos.View.ReposSortByName()
|
||||
for loop.Scan() {
|
||||
repo := loop.Repo()
|
||||
allTags := repo.AllTags()
|
||||
for _, t := range allTags {
|
||||
log.Info("found tag:", t.TagString(), "from", repo.Name())
|
||||
}
|
||||
}
|
||||
log.Info("fixme")
|
||||
}).SetProgName("TAGSLISTALL")
|
||||
|
||||
topGrid.NewButton("delete all dup tags", func() {
|
||||
me.autotypistWindow.Disable()
|
||||
defer me.autotypistWindow.Enable()
|
||||
loop := me.repos.View.ReposSortByName()
|
||||
for loop.Scan() {
|
||||
repo := loop.Repo()
|
||||
if repo.GoPath() == "go.wit.com/lib/gadgets" {
|
||||
// only do log for now
|
||||
} else {
|
||||
// continue
|
||||
}
|
||||
tagsW := repo.TagsBox()
|
||||
tagsW.PruneSmart()
|
||||
deleteTags := tagsW.List()
|
||||
for _, t := range deleteTags {
|
||||
tagW.grid.NewLabel(t.TagString())
|
||||
tagW.grid.NewLabel(repo.Name())
|
||||
tagW.grid.NewButton("delete", func() {
|
||||
repo.DeleteTag(t)
|
||||
})
|
||||
tagW.grid.NextRow()
|
||||
if me.autoDryRun.Checked() {
|
||||
log.Info("delete tag --dry-run:", t.TagString(), "from", repo.Name())
|
||||
} else {
|
||||
log.Info("Deleting tag:", t.TagString(), "from", repo.Name())
|
||||
go repo.DeleteTag(t)
|
||||
log.Sleep(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return tagW
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue