Pretty print json main config
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Ymnuk 2023-09-07 13:00:55 +03:00
parent 6e1fd8bfa9
commit 30d50e8be2
1 changed files with 8 additions and 3 deletions

11
main.go
View File

@ -151,11 +151,16 @@ func main() {
log.Fatal(err)
}
buff = nil
if buff, err = json.Marshal(&lib.Project); err != nil {
//buff = nil
var buffer bytes.Buffer
err = lib.PrettyEncode(&lib.Project, &buffer)
if err != nil {
log.Fatal(err)
}
if err = os.WriteFile(filepath.Join(dir, fmt.Sprintf("%s.json", filenameWithoutExt)), buff, 0755); err != nil {
/*if buff, err = json.Marshal(&lib.Project); err != nil {
log.Fatal(err)
}*/
if err = os.WriteFile(filepath.Join(dir, fmt.Sprintf("%s.json", filenameWithoutExt)), buffer.Bytes(), 0755); err != nil {
log.Fatal(err)
}