diff --git a/cmd/conf.go b/cmd/conf.go index eecb036..7955caa 100644 --- a/cmd/conf.go +++ b/cmd/conf.go @@ -1,17 +1,15 @@ package cmd import ( - "fmt" - + "github.com/sirupsen/logrus" "github.com/spf13/cobra" "github.com/synctv-org/synctv/internal/bootstrap" - "github.com/synctv-org/synctv/internal/conf" ) var ConfCmd = &cobra.Command{ Use: "conf", - Short: "conf", - Long: `config file`, + Short: "init or check", + Long: `Init or check config file for correctness`, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return bootstrap.New(bootstrap.WithContext(cmd.Context())).Add( bootstrap.InitConfig, @@ -21,7 +19,7 @@ var ConfCmd = &cobra.Command{ } func Conf(cmd *cobra.Command, args []string) error { - fmt.Println(conf.Conf.String()) + logrus.Infof("success") return nil } diff --git a/internal/conf/config.go b/internal/conf/config.go index 03a6354..c766731 100644 --- a/internal/conf/config.go +++ b/internal/conf/config.go @@ -2,8 +2,6 @@ package conf import ( "github.com/synctv-org/synctv/utils" - "github.com/zijiren233/stream" - "gopkg.in/yaml.v3" ) type Config struct { @@ -30,11 +28,6 @@ func (c *Config) Save(file string) error { return utils.WriteYaml(file, c) } -func (c *Config) String() string { - o, _ := yaml.Marshal(c) - return stream.BytesToString(o) -} - func DefaultConfig() *Config { return &Config{ // Log