diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -9,6 +9,8 @@ import ( "go.wit.com/lib/debugger" "go.wit.com/lib/gadgets" "go.wit.com/lib/gui/shell" + "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/lib/protobuf/forgepb" "go.wit.com/log" ) @@ -19,6 +21,10 @@ var DATE string // This is the beginning of the binary tree of GUI widgets var myGui *gui.Node +// this scans in the repos +var forge *forgepb.Forge +var repo *gitpb.Repo + var cBox *controlBox // this is a basic window. the user can open and close it @@ -34,6 +40,17 @@ func main() { println("go-deb --repo go.wit.com/apps/helloworld") os.Exit(0) } + forge = forgepb.Init() + os.Setenv("REPO_WORK_PATH", forge.GetGoSrc()) + + repo = forge.Repos.FindByGoPath(argv.Repo) + if repo == nil { + log.Info("repo not found. you need to clone", argv.Repo) + os.Exit(-1) + } + log.Info("found repo", argv.Repo) + // build() + myGui = gui.New() if !argv.Auto { myGui.InitEmbed(resources) @@ -65,7 +82,7 @@ func main() { cBox.computeControlValues() // verify the values for the package - if cBox.status == nil { + if repo == nil { if argv.Repo == "." { // this means try the local directory for a custom 'control' file } else { @@ -79,8 +96,8 @@ func main() { } // set the working directory to argv.Repo - log.Info("cd", cBox.status.Path()) - os.Chdir(cBox.status.Path()) + log.Info("cd", repo.FullPath) + os.Chdir(repo.FullPath) if argv.Auto { shell.TestTerminalColor() |
