|
43 | 43 | my $bugreporturl = 'https://github.com/libsdl-org/sdlwiki/issues/new';
|
44 | 44 | my $srcpath = undef;
|
45 | 45 | my $wikipath = undef;
|
46 |
| -my $wikireadmesubdir = 'README'; |
47 | 46 | my $warn_about_missing = 0;
|
48 | 47 | my $copy_direction = 0;
|
49 | 48 | my $optionsfname = undef;
|
@@ -1033,7 +1032,6 @@ sub generate_quickref {
|
1033 | 1032 | my $incpath = "$srcpath";
|
1034 | 1033 | $incpath .= "/$incsubdir" if $incsubdir ne '';
|
1035 | 1034 |
|
1036 |
| -my $wikireadmepath = "$wikipath/$wikireadmesubdir"; |
1037 | 1035 | my $readmepath = undef;
|
1038 | 1036 | if (defined $readmesubdir) {
|
1039 | 1037 | $readmepath = "$srcpath/$readmesubdir";
|
@@ -2082,18 +2080,15 @@ sub generate_quickref {
|
2082 | 2080 | }
|
2083 | 2081 |
|
2084 | 2082 | if (defined $readmepath) {
|
2085 |
| - if ( -d $wikireadmepath ) { |
2086 |
| - mkdir($readmepath); # just in case |
2087 |
| - opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n"); |
2088 |
| - while (readdir(DH)) { |
2089 |
| - my $dent = $_; |
2090 |
| - if ($dent =~ /\A(.*?)\.md\Z/) { # we only bridge Markdown files here. |
2091 |
| - next if $1 eq 'FrontPage'; |
2092 |
| - filecopy("$wikireadmepath/$dent", "$readmepath/README-$dent", "\n"); |
2093 |
| - } |
| 2083 | + mkdir($readmepath); # just in case |
| 2084 | + opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n"); |
| 2085 | + while (readdir(DH)) { |
| 2086 | + my $dent = $_; |
| 2087 | + if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-". |
| 2088 | + filecopy("$wikipath/$dent", "$readmepath/$dent", "\n"); |
2094 | 2089 | }
|
2095 |
| - closedir(DH); |
2096 | 2090 | }
|
| 2091 | + closedir(DH); |
2097 | 2092 | }
|
2098 | 2093 |
|
2099 | 2094 | } elsif ($copy_direction == -1) { # --copy-to-wiki
|
@@ -2698,31 +2693,27 @@ sub generate_quickref {
|
2698 | 2693 | # Write out READMEs...
|
2699 | 2694 | if (defined $readmepath) {
|
2700 | 2695 | if ( -d $readmepath ) {
|
2701 |
| - mkdir($wikireadmepath); # just in case |
| 2696 | + mkdir($wikipath); # just in case |
2702 | 2697 | opendir(DH, $readmepath) or die("Can't opendir '$readmepath': $!\n");
|
2703 | 2698 | while (my $d = readdir(DH)) {
|
2704 | 2699 | my $dent = $d;
|
2705 |
| - if ($dent =~ /\AREADME\-(.*?\.md)\Z/) { # we only bridge Markdown files here. |
2706 |
| - my $wikifname = $1; |
2707 |
| - next if $wikifname eq 'FrontPage.md'; |
2708 |
| - filecopy("$readmepath/$dent", "$wikireadmepath/$wikifname", "\n"); |
| 2700 | + if ($dent =~ /\AREADME\-.*?\.md\Z/) { # we only bridge Markdown files here that start with "README-". |
| 2701 | + filecopy("$readmepath/$dent", "$wikipath/$dent", "\n"); |
2709 | 2702 | }
|
2710 | 2703 | }
|
2711 | 2704 | closedir(DH);
|
2712 | 2705 |
|
2713 | 2706 | my @pages = ();
|
2714 |
| - opendir(DH, $wikireadmepath) or die("Can't opendir '$wikireadmepath': $!\n"); |
| 2707 | + opendir(DH, $wikipath) or die("Can't opendir '$wikipath': $!\n"); |
2715 | 2708 | while (my $d = readdir(DH)) {
|
2716 | 2709 | my $dent = $d;
|
2717 |
| - if ($dent =~ /\A(.*?)\.(mediawiki|md)\Z/) { |
2718 |
| - my $wikiname = $1; |
2719 |
| - next if $wikiname eq 'FrontPage'; |
2720 |
| - push @pages, $wikiname; |
| 2710 | + if ($dent =~ /\AREADME\-.*?\.md\Z/) { |
| 2711 | + push @pages, $dent; |
2721 | 2712 | }
|
2722 | 2713 | }
|
2723 | 2714 | closedir(DH);
|
2724 | 2715 |
|
2725 |
| - open(FH, '>', "$wikireadmepath/FrontPage.md") or die("Can't open '$wikireadmepath/FrontPage.md': $!\n"); |
| 2716 | + open(FH, '>', "$wikipath/README.md") or die("Can't open '$wikipath/README.md': $!\n"); |
2726 | 2717 | print FH "# All READMEs available here\n\n";
|
2727 | 2718 | foreach (sort @pages) {
|
2728 | 2719 | my $wikiname = $_;
|
|
0 commit comments