Skip to content

Commit

Permalink
dev: updated perl script for better new cards list generation
Browse files Browse the repository at this point in the history
  • Loading branch information
JayDi85 committed Aug 16, 2024
1 parent d75068a commit 3d6a281
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions Utils/find_new_cards.pl
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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)
Expand All @@ -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");
}
}
}

0 comments on commit 3d6a281

Please sign in to comment.