Skip to content

Instantly share code, notes, and snippets.

@Moligaloo
Created November 27, 2015 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Moligaloo/15c82ed4897c399b829c to your computer and use it in GitHub Desktop.
Save Moligaloo/15c82ed4897c399b829c to your computer and use it in GitHub Desktop.
Convert plist file to json file using Ruby
#!/usr/bin/env ruby
if ARGV.length < 2
puts "Usage: #{$PROGRAM_NAME} <plist_file> <json_file>"
exit 1
end
plist_file = ARGV[0]
json_file = ARGV[1]
require 'plist'
require 'json'
data = Plist::parse_xml(plist_file)
IO.write(json_file, JSON.pretty_generate(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment