add the dangerous things
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
f419286c05
commit
1c32636383
|
@ -56,7 +56,7 @@ func CheckReady() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
testf = filepath.Join(fullpath, "LICENSE")
|
testf = filepath.Join(fullpath, "LICENSE")
|
||||||
if ! Exists(testf) {
|
if !Exists(testf) {
|
||||||
log.Info("\trepo is not ready. missing LICENSE")
|
log.Info("\trepo is not ready. missing LICENSE")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"go.wit.com/gui"
|
"go.wit.com/gui"
|
||||||
"go.wit.com/lib/debugger"
|
"go.wit.com/lib/debugger"
|
||||||
"go.wit.com/lib/gui/logsettings"
|
"go.wit.com/lib/gui/logsettings"
|
||||||
|
"go.wit.com/log"
|
||||||
// "go.wit.com/gui/gadgets"
|
// "go.wit.com/gui/gadgets"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -69,23 +70,16 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
globalDisplayShow()
|
globalDisplayShow()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
me.ignoreWhitelist = group1.NewCheckbox("ignore whitelist (are you sure?)").SetChecked(false)
|
||||||
|
|
||||||
me.scanEveryMinute = group1.NewCheckbox("Scan every minute").SetChecked(false)
|
me.scanEveryMinute = group1.NewCheckbox("Scan every minute").SetChecked(false)
|
||||||
|
|
||||||
/*
|
|
||||||
group1.NewButton("status.Update() all", func() {
|
|
||||||
for _, repo := range me.allrepos {
|
|
||||||
repo.status.Update()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
group1.NewButton("rescan all", func() {
|
|
||||||
for _, repo := range me.allrepos {
|
|
||||||
repo.newScan()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
*/
|
|
||||||
group1.NewButton("set all branches to master", func() {
|
group1.NewButton("set all branches to master", func() {
|
||||||
for _, repo := range me.allrepos {
|
for _, repo := range me.allrepos {
|
||||||
|
if whitelist(repo.String()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if repo.status.CheckoutMaster() {
|
if repo.status.CheckoutMaster() {
|
||||||
log.Warn("set master branch worked", repo.String)
|
log.Warn("set master branch worked", repo.String)
|
||||||
repo.newScan()
|
repo.newScan()
|
||||||
|
@ -96,6 +90,24 @@ func globalDisplayOptions(box *gui.Node) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
group1.NewButton("rm -f go.mod go.sum", func() {
|
||||||
|
for _, repo := range me.allrepos {
|
||||||
|
if whitelist(repo.String()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
repo.status.RunCmd([]string{"rm", "-f", "go.mod", "go.sum"})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
group1.NewButton("git reset --hard", func() {
|
||||||
|
for _, repo := range me.allrepos {
|
||||||
|
if whitelist(repo.String()) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
repo.status.RunCmd([]string{"git", "reset", "--hard"})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
group2 := vbox.NewGroup("Debugger")
|
group2 := vbox.NewGroup("Debugger")
|
||||||
group2.NewButton("logging Window", func() {
|
group2.NewButton("logging Window", func() {
|
||||||
logsettings.LogWindow()
|
logsettings.LogWindow()
|
||||||
|
|
|
@ -40,7 +40,7 @@ type releaseStruct struct {
|
||||||
makeRedomodB *gui.Node
|
makeRedomodB *gui.Node
|
||||||
sendVersionB *gui.Node
|
sendVersionB *gui.Node
|
||||||
checkSafeB *gui.Node
|
checkSafeB *gui.Node
|
||||||
whitelist map[string]*repo
|
whitelist map[string]*repo
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *autoType) Disable() {
|
func (w *autoType) Disable() {
|
||||||
|
@ -51,17 +51,6 @@ func (w *autoType) Enable() {
|
||||||
w.mainWindow.Enable()
|
w.mainWindow.Enable()
|
||||||
}
|
}
|
||||||
|
|
||||||
func whitelist(path string) bool {
|
|
||||||
// log.Info("whitelist START", path)
|
|
||||||
_, ok := release.whitelist[path]
|
|
||||||
if ok {
|
|
||||||
// log.Info("whitelist ok == true", path)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
// log.Info("whitelist ok == false", path)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func createReleaseBox(box *gui.Node) {
|
func createReleaseBox(box *gui.Node) {
|
||||||
release.versionS = "0.17.0"
|
release.versionS = "0.17.0"
|
||||||
release.reasonS = "gocui"
|
release.reasonS = "gocui"
|
||||||
|
@ -361,30 +350,15 @@ func setCurrentRepo(newcur *repo, s string, note string) bool {
|
||||||
release.openrepo.Enable()
|
release.openrepo.Enable()
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if newcur.status.ReadOnly() {
|
if newcur.status.ReadOnly() {
|
||||||
release.readOnly.SetValue("true ro")
|
release.readOnly.SetValue("true ro")
|
||||||
} else {
|
} else {
|
||||||
release.readOnly.SetValue("false ro")
|
release.readOnly.SetValue("false ro")
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func initWhitelist() {
|
|
||||||
release.whitelist = make(map[string]*repo)
|
|
||||||
for _, repo := range me.allrepos {
|
|
||||||
if strings.HasPrefix(repo.String(), "go.wit.com/dev/") {
|
|
||||||
release.whitelist[repo.String()] = repo
|
|
||||||
}
|
|
||||||
if repo.String() == "go.wit.com/apps/guireleaser" {
|
|
||||||
release.whitelist[repo.String()] = repo
|
|
||||||
}
|
|
||||||
if repo.String() == "go.wit.com/lib/gui/repostatus" {
|
|
||||||
release.whitelist[repo.String()] = repo
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func scanForReady() bool {
|
func scanForReady() bool {
|
||||||
for _, repo := range me.allrepos {
|
for _, repo := range me.allrepos {
|
||||||
goSumS := repo.getGoSumStatus()
|
goSumS := repo.getGoSumStatus()
|
||||||
|
|
|
@ -26,6 +26,7 @@ type autoType struct {
|
||||||
// #### autotypist Global Display Options
|
// #### autotypist Global Display Options
|
||||||
autoHidePerfect *gui.Node
|
autoHidePerfect *gui.Node
|
||||||
autoHideReadOnly *gui.Node
|
autoHideReadOnly *gui.Node
|
||||||
|
ignoreWhitelist *gui.Node
|
||||||
|
|
||||||
// #### autotypist Global Build Options
|
// #### autotypist Global Build Options
|
||||||
// what to change all the branches to
|
// what to change all the branches to
|
||||||
|
|
|
@ -0,0 +1,36 @@
|
||||||
|
// This is a simple example
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func initWhitelist() {
|
||||||
|
release.whitelist = make(map[string]*repo)
|
||||||
|
for _, repo := range me.allrepos {
|
||||||
|
if strings.HasPrefix(repo.String(), "go.wit.com/dev/") {
|
||||||
|
release.whitelist[repo.String()] = repo
|
||||||
|
}
|
||||||
|
if repo.String() == "go.wit.com/apps/guireleaser" {
|
||||||
|
release.whitelist[repo.String()] = repo
|
||||||
|
}
|
||||||
|
if repo.String() == "go.wit.com/lib/gui/repostatus" {
|
||||||
|
release.whitelist[repo.String()] = repo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func whitelist(path string) bool {
|
||||||
|
// log.Info("whitelist START", path)
|
||||||
|
if me.ignoreWhitelist.Checked() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
_, ok := release.whitelist[path]
|
||||||
|
if ok {
|
||||||
|
// log.Info("whitelist ok == true", path)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
// log.Info("whitelist ok == false", path)
|
||||||
|
return false
|
||||||
|
}
|
Loading…
Reference in New Issue