diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 83 |
1 files changed, 49 insertions, 34 deletions
@@ -1,51 +1,66 @@ package main import ( - "os" - "path/filepath" - + "go.wit.com/dev/alexflint/arg" + "go.wit.com/gui" + "go.wit.com/lib/gui/repolist" "go.wit.com/lib/gui/shell" "go.wit.com/log" ) -// This is the beginning of the binary tree of GUI widgets -// var myGui *gui.Node +var VERSION string -// this is a basic window. the user can open and close it -// var basicWindow *gadgets.BasicWindow +var rv *repolist.RepoList func main() { - if args.Repo == "" { - log.Info("You need to tell me what repo you want to work on") - log.Info("") - log.Info("go-clone --repo go.wit.com/apps/helloworld") - os.Exit(0) + + var myargs args + // tmp := arg.MustParse(&myargs) + arg.MustParse(&myargs) + + if myargs.Work { + shell.Mkdir("work") + } else { + // filepath := filepath.Join("/home/jcarr/go/src") + // os.Chdir(filepath) } - /* - if args.Gui == "" { - myGui = gui.New() - myGui.Default() - } - */ + // if myargs.Repo == "" { + // // tmp.WriteHelp(os.Stdout) + // // fmt.Println("hello world") + // tmp := myargs.Description() + // fmt.Println(tmp) + // os.Exit(0) + // } - filepath := filepath.Join("/home/jcarr/go/src", args.Repo) - os.Chdir(filepath) + b := gui.RawBox() + rv = repolist.AutotypistView(b) - shell.TestTerminalColor() + // shell.TestTerminalColor() readControlFile() - os.Exit(0) - /* - // run the debugger if triggered from the commandline - if debugger.ArgDebug() { - go func() { - log.Sleep(2) - debugger.DebugWindow() - }() - } + clone(myargs.Repo) + rv.NewRepo(myargs.Repo) + + rv.NewRepo("go.wit.com/apps/helloworld") + + for _, repo := range rv.AllRepos() { + log.Info("found repo", repo.GoPath(), repo.Status.Path()) + } - // go will sit here until the window exits - gui.Watchdog() - os.Exit(0) - */ + rv.Watchdog(func() { + log.Info("watchdog") + }) } + +func clone(path string) { + shell.RunPath([]string{"git", "clone", path}) +} + +func findWorkDir() { + if myargs.Work { + shell.Mkdir("work") + shell.Mkdir("work") + } + // filepath := filepath.Join("/home/jcarr/go/src") + // os.Chdir(filepath) + |
