-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtbx.go
40 lines (34 loc) · 951 Bytes
/
tbx.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
package main
import (
"github.com/watermint/toolbox/catalogue"
"github.com/watermint/toolbox/essentials/log/esl"
"github.com/watermint/toolbox/essentials/log/wrapper/lgw_golog"
"github.com/watermint/toolbox/infra/control/app_bootstrap"
"github.com/watermint/toolbox/infra/control/app_catalogue"
"github.com/watermint/toolbox/infra/control/app_exit"
"github.com/watermint/toolbox/infra/control/app_resource"
"github.com/watermint/toolbox/resources"
"log"
"os"
)
func run(args []string, forTest bool) {
defer func() {
if r := recover(); r != nil {
if r == app_exit.Success {
return
} else {
panic(r)
}
}
}()
app_exit.SetTestMode(forTest)
bundle := resources.NewBundle()
app_resource.SetBundle(bundle)
app_catalogue.SetCurrent(catalogue.NewCatalogue())
log.SetOutput(lgw_golog.NewLogWrapper(esl.Default()))
b := app_bootstrap.NewBootstrap()
b.Run(b.Parse(args[1:]...))
}
func main() {
run(os.Args, false)
}