Skip to content

Commit f277211

Browse files
committed
watcher - mode + removed type
1 parent 1a33af1 commit f277211

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

bin/watcher.pl

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,20 @@
1818
>;
1919

2020
# args
21-
my ( $backpan, $dry_run );
21+
my ( $backpan, $dry_run, $mode );
2222
GetOptions(
2323
"backpan" => \$backpan,
2424
"dry_run" => \$dry_run,
25+
"mode=s" => \$mode,
2526
);
27+
# TODO: find a better way
28+
my @es_mode = ( $mode ? (mode => $mode) : () );
29+
$mode and $mode eq 'test' and Log::Log4perl::init('log4perl_test.conf');
2630

2731
# setup
2832
my $cpan = cpan_dir();
29-
my $es_release = MetaCPAN::ES->new( type => "release" );
30-
my $es_file = MetaCPAN::ES->new( type => "file" );
33+
my $es_release = MetaCPAN::ES->new( index => "release", @es_mode );
34+
my $es_file = MetaCPAN::ES->new( index => "file", @es_mode );
3135

3236
my $latest = 0;
3337
my @segments = qw< 1h 6h 1d 1W 1M 1Q 1Y Z >;

0 commit comments

Comments
 (0)