mirror of
https://github.com/thegeeklab/git-sv.git
synced 2024-11-10 02:10:38 +00:00
38 lines
576 B
Go
38 lines
576 B
Go
package commands
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/thegeeklab/git-sv/v2/app"
|
|
"github.com/urfave/cli/v2"
|
|
"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
|
|
}
|
|
}
|