Fix: conf for security, dont show

pull/21/head
zijiren233 2 years ago
parent 0a3a7b11b5
commit 7b709f55a9

@ -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
}

@ -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

Loading…
Cancel
Save