diff --git a/lib/MetaCPAN/Script/Latest.pm b/lib/MetaCPAN/Script/Latest.pm index 73b78154a..8e3515831 100644 --- a/lib/MetaCPAN/Script/Latest.pm +++ b/lib/MetaCPAN/Script/Latest.pm @@ -139,9 +139,19 @@ sub run { 'Searching for ' . @$filter . ' of ' . $total . ' modules' } if @module_filters > 1; - my $scroll = $self->index->type('file')->query($query)->source( [ qw( - author date distribution download_url module.name release status - ) ] )->size(100)->raw->scroll; + + my $scroll = $self->es->scroll_helper( { + index => $self->index->name, + type => 'file', + size => 100, + body => { + query => $query, + _source => [ + qw(author date distribution download_url module.name release status) + ], + sort => '_doc', + }, + } ); $found_total += $scroll->total; diff --git a/lib/MetaCPAN/Script/Runner.pm b/lib/MetaCPAN/Script/Runner.pm index 61245daf5..7a3bf4469 100644 --- a/lib/MetaCPAN/Script/Runner.pm +++ b/lib/MetaCPAN/Script/Runner.pm @@ -29,6 +29,14 @@ sub run { or File::Path::mkpath($path); } + if ( -t *STDERR ) { + push @{ $config->{logger} }, + { + class => 'Log::Log4perl::Appender::ScreenColoredLevels', + stdout => 0, + }; + } + my $obj = undef; my $ex = undef; try {