diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-03 14:54:55 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-10-10 00:23:01 +1100 |
commit | 4912205adb5e8e245b33b8e0d5581bcf0ec37e8a (patch) | |
tree | 90e28657c0af72cd0a880842f88750c01a32834d /main.go | |
parent | 9440dcf9de3214927125693e512cdc941ca4e123 (diff) |
remove viper
WIP
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,6 +1,7 @@ package main import ( + "bytes" "fmt" "log" "os" @@ -12,6 +13,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/app" "github.com/jesseduffield/lazygit/pkg/config" "github.com/jesseduffield/lazygit/pkg/env" + yaml "github.com/jesseduffield/yaml" ) var ( @@ -77,7 +79,13 @@ func main() { } if configFlag { - fmt.Printf("%s\n", config.GetDefaultConfig()) + var buf bytes.Buffer + encoder := yaml.NewEncoder(&buf) + err := encoder.Encode(config.GetDefaultConfig()) + if err != nil { + log.Fatal(err.Error()) + } + fmt.Printf("%v\n", buf.String()) os.Exit(0) } |