dev: updated perl script for better new cards list generation

This commit is contained in:
Oleg Agafonov 2024-08-16 04:48:59 +04:00
parent d75068a426
commit 3d6a2817ae

View file

@ -1,8 +1,9 @@
#!/usr/bin/perl -w
#author: spjspj
#author: spjspj, JayDi85
use strict;
use Data::Dumper;
my $addedCards;
my $GIT_CMD = "git.exe";
@ -141,6 +142,7 @@ if (exists ($new_order{$cmd}))
}
print ("Found these new card names!\n");
my %cards_by_sets;
foreach $line (sort keys (%new_cards))
{
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)){
print ("*** Set not found - probably card name is not exactly correct\n");
print ($line, "\n");
#print ("*** Set not found - probably card name is not exactly correct\n");
$set = "ZZZ - set not found";
#print ($line, "\n");
} 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");
}
}
}