mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08:00
dev: updated perl script for better new cards list generation
This commit is contained in:
parent
d75068a426
commit
3d6a2817ae
1 changed files with 29 additions and 7 deletions
|
|
@ -1,8 +1,9 @@
|
||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
|
|
||||||
#author: spjspj
|
#author: spjspj, JayDi85
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
|
use Data::Dumper;
|
||||||
|
|
||||||
my $addedCards;
|
my $addedCards;
|
||||||
my $GIT_CMD = "git.exe";
|
my $GIT_CMD = "git.exe";
|
||||||
|
|
@ -141,6 +142,7 @@ if (exists ($new_order{$cmd}))
|
||||||
}
|
}
|
||||||
|
|
||||||
print ("Found these new card names!\n");
|
print ("Found these new card names!\n");
|
||||||
|
my %cards_by_sets;
|
||||||
foreach $line (sort keys (%new_cards))
|
foreach $line (sort keys (%new_cards))
|
||||||
{
|
{
|
||||||
if ($new_cards {$line} > 0)
|
if ($new_cards {$line} > 0)
|
||||||
|
|
@ -161,15 +163,35 @@ if (exists ($new_order{$cmd}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#group cards by set
|
||||||
|
my $set = "";
|
||||||
|
my $card = $line;
|
||||||
if (!(length $setname)){
|
if (!(length $setname)){
|
||||||
print ("*** Set not found - probably card name is not exactly correct\n");
|
#print ("*** Set not found - probably card name is not exactly correct\n");
|
||||||
print ($line, "\n");
|
$set = "ZZZ - set not found";
|
||||||
|
#print ($line, "\n");
|
||||||
} else {
|
} else {
|
||||||
print ($line, " in ", $setname, "\n");
|
$set = $setname;
|
||||||
|
#print ($line, " in ", $setname, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my $cards = $cards_by_sets{$set};
|
||||||
|
if(!$cards){$cards=();$cards_by_sets{$set} = \@{$cards};}
|
||||||
|
push @{$cards}, $card;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# print in markdown format for release notes
|
||||||
|
print ("\n\n\n");
|
||||||
|
my $set;
|
||||||
|
#print Dumper(\%cards_by_sets);
|
||||||
|
foreach $set (sort keys (%cards_by_sets))
|
||||||
|
{
|
||||||
|
my $cards = $cards_by_sets{$set};
|
||||||
|
print ("* ", $set, " - added ", scalar @{$cards}, " new cards;", "\n");
|
||||||
|
foreach my $card (@{$cards})
|
||||||
|
{
|
||||||
|
print (" * ", $card, "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue