talls;
my $wanted = sub {
if ($_ eq 'install.json') {
push @installs, [ $File::Find::name, "$File::Find::dir/MYMETA.json" ];
}
};
File::Find::find($wanted, $lib
eturn 1;
}
};
for my $file (@installs) {
my $module = Carton::Util::load_json($file->[0]);
my $prereqs = -f $file->[1] ? CPAN::Meta->load_file($file->[1])->effective_p
heck> will warn you about
this:
$ carton check
Following dependencies are not satisfied.
JSON has version 2.51. Needs 2.52
Run `carton install` to install them.
You can run C<carton instal
;
use strict;
use warnings;
sub load_json {
my $file = shift;
open my $fh, "<", $file or die "$file: $!";
from_json(join '', <$fh>);
}
sub dump_json {
my($data, $file) = @_;
op
binmode $fh;
print $fh to_json($data);
}
sub from_json {
require JSON;
JSON::decode_json(@_);
}
sub to_json {
my($data) = @_;
require JSON;
JSON->new->utf8->pretty->canonical