package cmd

import (
	"fmt"
	"git.wanbits.cc/sin/flytalk/config"
	"git.wanbits.cc/sin/flytalk/models"
	"github.com/spf13/cobra"
)

var testCmd = &cobra.Command{
	Use:   "test",
	Short: "test config file",
	Run: func(cmd *cobra.Command, args []string) {
		test()
	},
}

func test() {
	_, err := config.LoadConf(Confile)
	if err != nil {
		panic(err)
	}
	models.InitDb()

	fmt.Printf("config file <%v> tested successful. and connect database well.\n", Confile)
}
