-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathmain.go
50 lines (41 loc) · 933 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
45
46
47
48
49
50
package main
import (
"embed"
"os"
"github.com/gin-admin/gin-admin-cli/v10/cmd"
"github.com/gin-admin/gin-admin-cli/v10/internal/tfs"
"github.com/urfave/cli/v2"
"go.uber.org/zap"
)
//go:embed tpls
var f embed.FS
var VERSION = "v10.7.0"
func main() {
defer func() {
_ = zap.S().Sync()
}()
// Set the embed.FS to the fs package
tfs.SetEFS(f)
logger, err := zap.NewDevelopmentConfig().Build(zap.WithCaller(false))
if err != nil {
panic(err)
}
zap.ReplaceGlobals(logger)
app := cli.NewApp()
app.Name = "gin-admin-cli"
app.Version = VERSION
app.Usage = "A command line tool for [gin-admin](https://github.com/LyricTian/gin-admin)."
app.Authors = append(app.Authors, &cli.Author{
Name: "LyricTian",
Email: "[email protected]",
})
app.Commands = []*cli.Command{
cmd.Version(VERSION),
cmd.New(),
cmd.Generate(),
cmd.Remove(),
}
if err := app.Run(os.Args); err != nil {
panic(err)
}
}