release: new project template
This commit is contained in:
39
coco/main.go
Normal file
39
coco/main.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"gitter.top/coco/bootstrap"
|
||||
)
|
||||
|
||||
var (
|
||||
rootCmd = &cobra.Command{
|
||||
Use: "coco",
|
||||
Short: "golang project toolkit",
|
||||
}
|
||||
)
|
||||
|
||||
func init() {
|
||||
logrus.SetFormatter(&logrus.TextFormatter{
|
||||
ForceColors: true,
|
||||
EnvironmentOverrideColors: true,
|
||||
DisableTimestamp: true,
|
||||
DisableSorting: true,
|
||||
DisableLevelTruncation: false,
|
||||
PadLevelText: false,
|
||||
QuoteEmptyFields: false,
|
||||
})
|
||||
rootCmd.AddCommand(bootstrap.Update())
|
||||
rootCmd.AddCommand(bootstrap.CreateProject())
|
||||
rootCmd.AddCommand(bootstrap.AddAPICommand())
|
||||
rootCmd.AddCommand(bootstrap.AddServiceCommand())
|
||||
rootCmd.AddCommand(bootstrap.GenerateProtoFile())
|
||||
rootCmd.AddCommand(bootstrap.InjectProtoFile())
|
||||
}
|
||||
|
||||
func main() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
logrus.Fatalln(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user