use lib '../../perl/build/lib';
use strict;
use warnings;
-use JSON;
use Getopt::Long;
use Git;
use Cwd qw(realpath);
while (scalar @ARGV) {
my $arg = $ARGV[0];
my $dir;
+ my $prefix = '';
last if -f $arg or $arg eq "--";
if (! -d $arg) {
my $rev = Git::command_oneline(qw(rev-parse --verify), $arg);
} else {
$dir = realpath($arg);
$dirnames{$dir} = $dir;
+ $prefix .= 'bindir';
}
push @dirs, $dir;
$dirnames{$dir} ||= $arg;
- my $prefix = $dir;
+ $prefix .= $dir;
$prefix =~ tr/^a-zA-Z0-9/_/c;
$prefixes{$dir} = $prefix . '.';
shift @ARGV;
}
}
- print to_json(\@data, {utf8 => 1, pretty => 1, canonical => 1}), "\n";
+ require JSON;
+ print JSON::to_json(\@data, {utf8 => 1, pretty => 1, canonical => 1}), "\n";
}
binmode STDOUT, ":utf8" or die "PANIC on binmode: $!";