Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add a tools/ directory, containing a simple JSON prettifier to make i…
…t easier to look up details in the perl6-module-list
  • Loading branch information
japhb committed Feb 17, 2013
1 parent a53a394 commit 63fd354
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tools/prettify-json
@@ -0,0 +1,15 @@
#!/usr/bin/env perl

use strict;
use warnings;
use JSON;
use FindBin;
use File::Slurp;

my $raw_file = $ARGV[0] || "$FindBin::Bin/../data-sources/perl6-module-list.json";
my $pretty_file = $raw_file;
$pretty_file =~ s/(\.json)$/-pretty$1/;

my $raw = read_file($raw_file);
my $pretty = to_json(from_json($raw), { pretty => 1});
write_file($pretty_file, $pretty);

0 comments on commit 63fd354

Please sign in to comment.