summaryrefslogtreecommitdiff
path: root/globalBuildOptions.go
diff options
context:
space:
mode:
Diffstat (limited to 'globalBuildOptions.go')
-rw-r--r--globalBuildOptions.go75
1 files changed, 75 insertions, 0 deletions
diff --git a/globalBuildOptions.go b/globalBuildOptions.go
index d721293..bcbdf72 100644
--- a/globalBuildOptions.go
+++ b/globalBuildOptions.go
@@ -97,3 +97,78 @@ func globalBuildOptions(vbox *gui.Node) {
me.autoCreateBranches = grid.NewCheckbox("create if missing").SetChecked(true)
grid.NextRow()
}
+
+// this code isn't ready yet
+/*
+ s.gitPullB = grid.NewButton("git pull", func() {
+ me.Disable()
+ defer me.Enable()
+ for _, repo := range repolist.AllRepos() {
+ // gitcmd := []string{"git", "fetch", "origin"}
+ gitcmd := []string{"git", "pull"}
+ err, output := repo.RunCmd(gitcmd)
+ log.Info("output =", output)
+ if err == nil {
+ log.Info("git fetch worked", repo.Name())
+ } else {
+ log.Info("git fetch failed", repo.Name())
+ return
+ }
+ }
+ gitPullB.SetText("GOOD")
+ // update the stats
+ // s.Update()
+ })
+
+ s.gitPushB = grid.NewButton("git push", func() {
+ me.Disable()
+ defer me.Enable()
+ for _, repo := range repolist.AllRepos() {
+ gitcmd := []string{"git", "push"}
+ err, output := repo.RunCmd(gitcmd)
+ log.Info("output =", output)
+ if err == nil {
+ log.Info("git push worked", repo.Name())
+ } else {
+ log.Info("git push failed", repo.Name())
+ return
+ }
+ }
+ s.gitPushB.SetText("GOOD")
+ // update the stats
+ s.Update()
+ })
+
+ s.checkB = s.grid.NewButton("Check repos are working", func() {
+ me.Disable()
+ defer me.Enable()
+ for _, repo := range repolist.AllRepos() {
+ if repo.GitURL() != "" {
+ log.Info("repo already checked. do they match?")
+ log.Info("go.wit.com =", repo.GoURL())
+ log.Info("localurl =", repo.Path())
+ } else {
+ ok, giturl := gowit.CheckRegistered(repo)
+ if ok {
+ log.Info("is url correct?", repo.Path(), "vs", giturl)
+ repo.giturl = giturl
+ if giturl != repo.Path() {
+ log.Info("repo check failed", repo.String())
+ s.unknownOL.SetText(repo.String())
+ s.unknownOL.Show()
+ s.unknownSubmitB.Show()
+ return
+ }
+ } else {
+ log.Info("repo check failed", repo.String())
+ repo.giturl = "look in .git/config"
+ s.unknownOL.SetText(repo.String())
+ s.unknownOL.Show()
+ s.unknownSubmitB.Show()
+ return
+ }
+ }
+ }
+ s.checkB.SetText("GOOD")
+ })
+*/