summaryrefslogtreecommitdiff
path: root/main.go
blob: e7a97f8989db1e27c2578da37c594d967332fe90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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)