0
0
mirror of https://github.com/thegeeklab/git-sv.git synced 2024-11-28 16:40:36 +00:00
git-sv/app/commands/config.go

38 lines
573 B
Go
Raw Normal View History

package commands
import (
"fmt"
2023-10-16 19:41:33 +00:00
"github.com/thegeeklab/git-sv/app"
"github.com/urfave/cli/v2"
2023-10-15 19:45:47 +00:00
"gopkg.in/yaml.v3"
)
func ConfigDefaultHandler() cli.ActionFunc {
return func(c *cli.Context) error {
cfg := app.GetDefault()
content, err := yaml.Marshal(&cfg)
if err != nil {
return err
}
fmt.Println(string(content))
return nil
}
}
func ConfigShowHandler(cfg *app.Config) cli.ActionFunc {
return func(c *cli.Context) error {
content, err := yaml.Marshal(cfg)
if err != nil {
return err
}
fmt.Println(string(content))
return nil
}
}