-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix pretty JSON generation #48
Comments
Which version are you using and which data are you referring to? |
I am using version v0.0.11 and i am referring to the minified JSON, for example in the roles backup files. |
@DarkGigabyte - thx, by any chance did you look into other files that you backed up? |
Yeah, i did. The data bags are fine and pretty formatted. The other categories are all not/unpretty formatted. |
@DarkGigabyte Send me an example if can. Mine look fine... |
Example of unpretty environment "development" exported on Linux Mint: How it should look pretty formatted: |
it was prettified in 0.0.8, but something changed between 0.0.8-0.0.10 please add prettifying back, as i'm commiting the backup versions to git, it would be easier to see changes if prettified. EDIT: i think the real change was with underlying ruby upgrade 1.9 -> 2.4 |
i don't get it. if i read and invoke file_name = 'nodes/example.json'
data = File.read(file_name)
some_data = JSON.parse(data)
encoded = JSON.pretty_generate(some_data)
yourfile = '/tmp/out.json'
File.open(yourfile, 'w') { |file| file.write(encoded) } and the code uses same method: https://github.com/mdxp/knife-backup/blob/v0.0.12/lib/chef/knife/backup_export.rb#L127 |
i'm even more puzzled, i updated 0.0.10 to 0.0.12 and the output is prettified. versions (mostly note to myself):
|
so, imho it can be closed. as output is prettified |
see: http://stackoverflow.com/questions/2567670/ruby-json-pretty-generate-is-pretty-unpretty
It would be really nice for reading and editing the backups before restoring them.
The text was updated successfully, but these errors were encountered: