-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
53 lines (45 loc) · 1.28 KB
/
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
51
52
53
// This file is autogenerated by hexya-server
// DO NOT MODIFY THIS FILE - ANY CHANGES WILL BE OVERWRITTEN
package main
import (
"fmt"
"os"
_ "github.com/halybang/hexya-addons/websocket"
_ "github.com/hexya-addons/base"
_ "github.com/hexya-addons/web"
_ "github.com/hexya-addons/webKanban"
"github.com/hexya-erp/hexya/cmd"
"github.com/spf13/cobra"
)
func main() {
var hexyaCmd = &cobra.Command{
Use: ".",
Short: "Hexya is an open source modular ERP",
Long: "Hexya is an open source modular ERP written in Go. It is designed for high demand business data processing while being easily customizable",
}
cmd.SetHexyaFlags(hexyaCmd)
var serverCmd = &cobra.Command{
Use: "server",
Short: "Start the Hexya server",
Long: "Start the Hexya server",
Run: func(c *cobra.Command, args []string) {
cmd.StartServer()
},
}
hexyaCmd.AddCommand(serverCmd)
cmd.SetServerFlags(serverCmd)
var updateDBCmd = &cobra.Command{
Use: "updatedb",
Short: "Update the database schema",
Long: "Synchronize the database schema with the models definitions.",
Run: func(c *cobra.Command, args []string) {
cmd.UpdateDB()
},
}
hexyaCmd.AddCommand(updateDBCmd)
cobra.OnInitialize(cmd.InitConfig)
if err := hexyaCmd.Execute(); err != nil {
fmt.Println(err)
os.Exit(-1)
}
}