go-clone/main.go

67 lines
1.2 KiB
Go

package main
import (
"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"
)
var VERSION string
var rv *repolist.RepoList
func main() {
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 myargs.Repo == "" {
// // tmp.WriteHelp(os.Stdout)
// // fmt.Println("hello world")
// tmp := myargs.Description()
// fmt.Println(tmp)
// os.Exit(0)
// }
b := gui.RawBox()
rv = repolist.AutotypistView(b)
// shell.TestTerminalColor()
readControlFile()
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())
}
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)