cake-contrib/Cake.Json

Feature Request: Add option to pretty print / format Json output

Closed this issue · 3 comments

It would be really nice if we had the option to pretty print (indent) the json serialised output - especially when using SerializeJsonToFile.
Use Case - I am using Cake.Json to update the version number of a DotNetCore application and it would nice if after running the build did not have to manually pretty print my project.json.
This could be achieved by adding an optional parameter to SerializeJsonToFile and calling JsonConvert.SerializeObject with Indent.

Theres a PR available here: #7

This has already been implemented 😄
Here are the aliases:
SerializeJsonPretty
SerializeJsonPrettyFile

gep13 commented

Agreed, looks like this has already shipped.