summaryrefslogtreecommitdiff
path: root/scanGoSrc/main.go
blob: ff24c9c725125977d7e046688d27abb8c95a2b62 (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
package main

import (
	"os"

	"go.wit.com/lib/protobuf/forgepb"
	"go.wit.com/lib/protobuf/gitpb"
	"go.wit.com/log"
)

// sent via ldflags
var VERSION string

func main() {
	var config forgepb.ForgeConfigs
	if err := config.ConfigLoad(); err != nil {
		log.Warn("forgepb.ConfigLoad() failed", err)
		os.Exit(-1)
	}

	config.PrintTable()

	var repos *gitpb.Repos
	repos = new(gitpb.Repos)

	newr, err := repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/wit-package")
	if err != nil {
		log.Info("init failed", err)
	} else {
		log.Info("init worked for", newr.GoPath)
	}

	newr, err = repos.NewGoPath("/home/jcarr/go/src", "go.wit.com/apps/notathing")
	if err != nil {
		log.Info("init failed correctly:", err)
	} else {
		log.Info("init should have failed for", newr.GoPath)
	}

	/*
		log.Info(forgepb.RepoHeader())
		loop := repos.SortByPath() // get the list of repos
		for loop.Scan() {
			r := loop.Repo()
			log.Info("repo:", r.GoPath)
		}
	*/
	/*
		log.Info("going to add a new repo", argv.GoPath)
		new1 := forgepb.Repo{
			GoPath:      argv.GoPath,
			Writable:    argv.Writable,
			ReadOnly:    argv.ReadOnly,
			Private:     argv.Private,
			Directory:   argv.Directory,
			Favorite:    argv.Favorite,
			Interesting: argv.Interesting,
		}
	*/
	os.Exit(0)
}