summaryrefslogtreecommitdiff
path: root/forge.go
blob: 41cd2425f23264238bd8cf3466af6bf3391ff1b3 (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
package main

import (
	"os"

	"go.wit.com/gui"
	"go.wit.com/lib/protobuf/forgepb"
	"go.wit.com/log"
)

// if there is no "build" file
// the attempt to use forgepb to init
// the GO repo
func doForge() {
	me.forge = forgepb.Init()
	os.Setenv("REPO_WORK_PATH", me.forge.GetGoSrc())

	me.repo = me.forge.Repos.FindByFullPath(argv.Forge)
	if me.repo == nil {
		log.Info("repo not found", argv.Forge)
		me.repo = me.forge.FindByGoPath(argv.Forge)
	}
	if me.repo == nil {
		log.Info("I could not determine which go repo you have", argv.Forge)
		log.Info("you must create a build & control file", argv.Forge)
		os.Exit(-1)
	}
	log.Info("found repo", me.repo.GetGoPath())
	// build()
}

func doGui() {
	me.myGui = gui.New()
	if !argv.Auto {
		me.myGui.InitEmbed(resources)
	}
	me.myGui.Default()

	me.basicWindow.Show()
	// go will sit here until the window exits
	gui.Watchdog()
	os.Exit(0)
}