|
|
@ -1,17 +1,15 @@
|
|
|
|
package cmd
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"github.com/sirupsen/logrus"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/synctv-org/synctv/internal/bootstrap"
|
|
|
|
"github.com/synctv-org/synctv/internal/bootstrap"
|
|
|
|
"github.com/synctv-org/synctv/internal/conf"
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var ConfCmd = &cobra.Command{
|
|
|
|
var ConfCmd = &cobra.Command{
|
|
|
|
Use: "conf",
|
|
|
|
Use: "conf",
|
|
|
|
Short: "conf",
|
|
|
|
Short: "init or check",
|
|
|
|
Long: `config file`,
|
|
|
|
Long: `Init or check config file for correctness`,
|
|
|
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
return bootstrap.New(bootstrap.WithContext(cmd.Context())).Add(
|
|
|
|
return bootstrap.New(bootstrap.WithContext(cmd.Context())).Add(
|
|
|
|
bootstrap.InitConfig,
|
|
|
|
bootstrap.InitConfig,
|
|
|
@ -21,7 +19,7 @@ var ConfCmd = &cobra.Command{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func Conf(cmd *cobra.Command, args []string) error {
|
|
|
|
func Conf(cmd *cobra.Command, args []string) error {
|
|
|
|
fmt.Println(conf.Conf.String())
|
|
|
|
logrus.Infof("success")
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|