Created
November 27, 2015 08:08
-
-
Save Moligaloo/15c82ed4897c399b829c to your computer and use it in GitHub Desktop.
Convert plist file to json file using Ruby
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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