-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
44 lines (36 loc) · 829 Bytes
/
main.go
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
package main
import (
"flag"
"bobthebuilder/builder"
"bobthebuilder/config"
"bobthebuilder/web"
)
var (
definitionsDir = flag.String("definitions_dir", "definitions", "Path to the directory containing definition files")
baseDir = flag.String("base_dir", "base", "Path to the directory containing base files")
buildDir = flag.String("build_dir", "build", "Path to the directory where builds will take place")
)
func main() {
flag.Parse()
if flag.Arg(0) != "" {
e := config.Load(flag.Arg(0))
if e != nil {
return
}
} else {
e := config.Load("config.json")
if e != nil {
return
}
}
b := builder.GetInstance()
builder.DefinitionsDir = *definitionsDir
builder.BuildDir = *buildDir
builder.BaseDir = *baseDir
e := b.Init()
if e != nil {
return
}
web.Initialise()
web.Run()
}