Last active
December 23, 2015 00:58
-
-
Save erran/6556862 to your computer and use it in GitHub Desktop.
A script that validates the syntax of all of the JSON files in your CWD recursively. Run it by copying and pasting it into irb after you've cd'd into the correct directory.
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 | |
# vi: set ft=ruby | |
require 'json' | |
Dir['**/*.json'].each do |json| | |
puts json | |
JSON.parse(File.read(json)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment