Quellcode durchsuchen

Update magic gen-docs script to not mangle Perl repo links

Tianon Gravi vor 11 Jahren
Ursprung
Commit
f81dcb36a6
3 geänderte Dateien mit 16 neuen und 5 gelöschten Zeilen
  1. 2 2
      README-footer.md
  2. 12 1
      gen-docs.sh
  3. 2 2
      perl/README.md

+ 2 - 2
README-footer.md

@@ -3,10 +3,10 @@
 
 
 ## Issues
 ## Issues
 
 
-If you have any questions about the image, please contact us %%MAILING_LIST%% through a [GitHub issue](https://github.com/docker-library/%%REPO%%/issues) or in the IRC channel `#docker-library` on [Freenode](https://freenode.net).
+If you have any questions about the image, please contact us %%MAILING_LIST%% through a [GitHub issue](%%REPO%%/issues) or in the IRC channel `#docker-library` on [Freenode](https://freenode.net).
 
 
 ## Contributing
 ## Contributing
 
 
 If you want to contribute new features or updates, we are always thrilled to receive pull requests, and do our best to process them as fast as possible.
 If you want to contribute new features or updates, we are always thrilled to receive pull requests, and do our best to process them as fast as possible.
 
 
-We recommend discussing your plans %%MAILING_LIST%% through a [GitHub issue](https://github.com/docker-library/%%REPO%%/issues) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.
+We recommend discussing your plans %%MAILING_LIST%% through a [GitHub issue](%%REPO%%/issues) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.

+ 12 - 1
gen-docs.sh

@@ -10,6 +10,14 @@ fi
 repos=( "${repos[@]%/}" )
 repos=( "${repos[@]%/}" )
 
 
 for repo in "${repos[@]}"; do
 for repo in "${repos[@]}"; do
+	case "$repo" in
+		perl)
+			gitRepo="https://github.com/Perl/docker-perl"
+			;;
+		*)
+			gitRepo="https://github.com/docker-library/$repo"
+			;;
+	esac
 	if [ -e "$repo/README-content.md" ]; then
 	if [ -e "$repo/README-content.md" ]; then
 		mailingList="$(cat "$repo/mailing-list.md" 2>/dev/null |  sed 's/[\/&]/\\&/g' || true)"
 		mailingList="$(cat "$repo/mailing-list.md" 2>/dev/null |  sed 's/[\/&]/\\&/g' || true)"
 		if [ "$mailingList" ]; then
 		if [ "$mailingList" ]; then
@@ -22,7 +30,10 @@ for repo in "${repos[@]}"; do
 			echo "cat $repo/README-content.md README-footer.md > $repo/README.md"
 			echo "cat $repo/README-content.md README-footer.md > $repo/README.md"
 			cat "$repo/README-content.md" "README-footer.md" > "$repo/README.md"
 			cat "$repo/README-content.md" "README-footer.md" > "$repo/README.md"
 			set -x
 			set -x
-			sed -ri 's/\s*%%MAILING_LIST%%\s*/'"$mailingList"'/g; s/%%REPO%%/'"$repo"'/g' "$repo/README.md"
+			sed -ri '
+				s/\s*%%MAILING_LIST%%\s*/'"$mailingList"'/g;
+				s!%%REPO%%!'"$gitRepo"'!g;
+			' "$repo/README.md"
 		)
 		)
 	else
 	else
 		echo "skipping $repo: repo/README-content.md"
 		echo "skipping $repo: repo/README-content.md"

+ 2 - 2
perl/README.md

@@ -27,10 +27,10 @@ For many single file projects, it may not be convenient to write a `Dockerfile`
 
 
 ## Issues
 ## Issues
 
 
-If you have any questions about the image, please contact us through a [GitHub issue](https://github.com/Perl/perl/issues) or in the IRC channel `#docker-library` on [Freenode](https://freenode.net).
+If you have any questions about the image, please contact us through a [GitHub issue](https://github.com/Perl/docker-perl/issues) or in the IRC channel `#docker-library` on [Freenode](https://freenode.net).
 
 
 ## Contributing
 ## Contributing
 
 
 If you want to contribute new features or updates, we are always thrilled to receive pull requests, and do our best to process them as fast as possible.
 If you want to contribute new features or updates, we are always thrilled to receive pull requests, and do our best to process them as fast as possible.
 
 
-We recommend discussing your plans through a [GitHub issue](https://github.com/Perl/perl/issues) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.
+We recommend discussing your plans through a [GitHub issue](https://github.com/Perl/docker-perl/issues) before starting to code - especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give feedback on your design, and maybe point out if someone else is working on the same thing.