Adjust the sort order of the new-notes files

Preparing to sort PR-999.md and PR-1000.md correctly
This commit is contained in:
Andrew Johnson authored and Dirk Zimoch committed 2026-10-13 10:18:02 +02:00
1 parent 362bb3300e
commit ce00a50fd8
1 file changed
+9 -1
+9 -1
View File
@@ -58,7 +58,15 @@ if ($opt_d) {
opendir my $dh, $opt_d or
die "$tool: Can't open '-d' directory: $!\n";
foreach my $fn (sort grep !m/^ \. \.? $/x, readdir $dh) {
# Get filenames, exclude dot-files, sort <alpha><num><alpha>
my @files = sort {
my $rx = qr/^ (\D+) (\d+) (.*) $/x;
my @a = ($a =~ m/$rx/);
my @b = ($b =~ m/$rx/);
$a[0] cmp $b[0] || $a[1] <=> $b[1] || $a[2] cmp $b[2];
} grep !m/^ \. \.? $/x, readdir $dh;
foreach my $fn (@files) {
next if $fn eq 'README.txt';
die "$tool: Not markdown? File '$fn' lacks '.md' extension\n"
unless $fn =~ m/\.md$/;