diff --git a/Utils/find_new_cards.pl b/Utils/find_new_cards.pl index 27e1bdfdfb36..d07861d15ae0 100644 --- a/Utils/find_new_cards.pl +++ b/Utils/find_new_cards.pl @@ -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 @@ sub get_name_of_card_from_class } 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 @@ sub get_name_of_card_from_class } } - + #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"); + } + } } \ No newline at end of file