Skip to content

Commit 4e8a29b

Browse files
authored
Merge pull request #73 from metacpan/mickey/author
bin/author.pl - allow alternative file (for testing)
2 parents 78b01db + d0d5ca7 commit 4e8a29b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

bin/author.pl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,17 +51,18 @@
5151
};
5252

5353
# args
54-
my ( $pauseid, $whois_file );
54+
my ( $mode, $pauseid, $whois_file );
5555
GetOptions(
56-
"whois_file=s" => \$whois_file,
56+
"mode=s" => \$mode,
5757
"pauseid=s" => \$pauseid,
58+
"whois_file=s" => \$whois_file,
5859
);
5960

6061
# setup
61-
my $es = MetaCPAN::ES->new( type => "author" );
62+
my $es = MetaCPAN::ES->new( index => "author", ( $mode ? ( mode => $mode ) : () ) );
6263

6364
log_info {'Reading 00whois'};
64-
my $authors_data = $whois_file || read_00whois();
65+
my $authors_data = read_00whois( $whois_file );
6566

6667
if ($pauseid) {
6768
log_info {"Indexing 1 author"};
@@ -239,7 +240,7 @@ ()
239240
sub new_authors () {
240241
for my $id ( keys %$authors_data ) {
241242
my $whois_data = delete $authors_data->{$id} || next;
242-
_update_author( $id, $whois_data );
243+
_update_author( $id, $whois_data, {} );
243244
}
244245
}
245246

0 commit comments

Comments
 (0)