summaryrefslogtreecommitdiff
path: root/unreleaseWindow.go
blob: 8cf20dca09935b4803b809a5fc108a0777cf27e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// This is a simple example
package main

import (
	"go.wit.com/gui"
	"go.wit.com/log"
)

func createUnreleaseBox(box *gui.Node) {
	group := release.box.NewGroup("undo and redo things")

	group.NewButton("punk the zip", func() {
		me.Disable()
		defer me.Enable()
	})
	group.NewButton("re-release"+release.versionS, func() {
		me.Disable()
		defer me.Enable()

		if release.current.status.CheckDirty() {
			log.Info("sorry, it's still dirty")
			return
		}

		curName := release.current.status.GetCurrentBranchName()
		mName := release.current.status.GetMasterBranchName()
		if curName != mName {
			log.Info("\trepo is not working from main branch", curName, "!=", mName)
			return
		}

		log.Info("\treset to devel", curName, release.versionS, release.reasonS)

		release.current.status.RunCmd([]string{"git", "checkout", "devel"})
		release.current.status.RunCmd([]string{"git", "branch", "-d", mName})
		/*
			release.current.status.RunCmd([]string{"git", "add", "-f", "go.sum"})
			release.current.status.RunCmd([]string{"git", "commit", "-m", release.reasonS})
			release.current.status.RunCmd([]string{"git", "push"})
			release.current.status.RunCmd([]string{"git", "tag", "-m", release.reasonS, "v" + release.versionS})
			release.current.status.RunCmd([]string{"git", "push", "origin", "v" + release.versionS})
		*/
	})
}