go-deb/forge.go

44 lines
888 B
Go

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)
}