-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbake.go
More file actions
49 lines (41 loc) · 980 Bytes
/
Copy pathbake.go
File metadata and controls
49 lines (41 loc) · 980 Bytes
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
package main
import (
"fmt"
"os"
"github.com/B9O2/bake/apps"
"github.com/B9O2/Inspector/decorators"
. "github.com/B9O2/Inspector/templates/simple"
"github.com/B9O2/canvas/pixel"
"github.com/B9O2/tabby"
)
func main() {
var args []string
if len(os.Args) > 1 {
args = os.Args[1:]
} else {
args = []string{"default"}
}
buildApp := apps.NewBuildApp()
initRecipeApp := apps.NewInitRecipeApp()
listRecipesApp := apps.NewListRecipesApp()
mainApp := apps.NewMainApp("main", "./RECIPE.toml", initRecipeApp, listRecipesApp)
t := tabby.NewTabby("Bake", mainApp)
t.SetUnknownApp(buildApp)
tc, err := t.Run(args)
if err != nil {
Insp.Print(Error(err))
return
}
if tc != nil {
tc.Display(pixel.Space)
}
}
func init() {
Insp.SetTypeDecorations("_func", decorators.Invisible)
Insp.NewAutoType("id", func() interface{} {
return ":bake:"
}, func(i interface{}) string {
return fmt.Sprint(i)
}, decorators.Gray)
Insp.SetOrders("_time", Level, "id")
}