diff options
Diffstat (limited to 'forge.go')
| -rw-r--r-- | forge.go | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/forge.go b/forge.go new file mode 100644 index 0000000..41cd242 --- /dev/null +++ b/forge.go @@ -0,0 +1,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) +} |
