delete everything button

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-25 11:35:40 -06:00
parent ff978958b0
commit c05eacf45a
2 changed files with 12 additions and 13 deletions

View File

@ -10,28 +10,24 @@ func globalResetOptions(box *gui.Node) {
buildOptions := group2.NewGrid("buildOptions", 2, 1)
buildOptions.NewLabel("start over")
buildOptions.NewButton("rm ~/go/src & ~/go/pkg", func() {
me.deleteGoSrcPkgB = buildOptions.NewButton("rm ~/go/src & ~/go/pkg", func() {
for _, repo := range me.allrepos {
// status := repo.getStatus()
if repo.status.CheckDirty() {
log.Warn("repo is dirty. commit your changes first", repo.String())
me.deleteGoSrcPkgB.SetLabel("rm ~/go/src (can't. dirty repos)")
return
} else {
log.Warn("repo is not dirty", repo.String())
log.Warn("TODO: check things are pushed and check every dir in go/src/")
me.deleteGoSrcPkgB.SetLabel("ARE YOU SURE?")
if me.deleteGoSrcPkgB.String() == "ARE YOU SURE?" {
fullpath := "/home/jcarr/go/"
quickCmd(fullpath, []string{"rm", "-rf", "/home/jcarr/go/src/"})
quickCmd(fullpath, []string{"chmod", "700", "-R", "/home/jcarr/go/pkg/"})
quickCmd(fullpath, []string{"rm", "-rf", "/home/jcarr/go/pkg/"})
}
}
}
/*
newCmds = append(newCmds, []string{"cd", "/home/jcarr/"})
newCmds = append(newCmds, []string{"rm", "-rf", "go/src/"})
newCmds = append(newCmds, []string{"chmod", "700", "-R", "go/pkg/"})
newCmds = append(newCmds, []string{"rm", "-rf", "go/pkg/"})
if dirty {
newCmds = append(newCmds, []string{"can't do this with dirty repos"})
} else {
}
*/
})
buildOptions.NewSeparator("endStatusScans")
buildOptions.NewSeparator("endStatusScans")
}

View File

@ -53,6 +53,9 @@ type autoType struct {
autoWorkingPwd *gadgets.OneLiner
downloadEverythingButton *gui.Node
// delete ~/go/src & ~/go/pkg buttons
deleteGoSrcPkgB *gui.Node
}
/*