Răsfoiți Sursa

Update "generate-repo-stub-readme.sh" to skip "unknown" Travis badges and to include AppVeyor badges where applicable!

Tianon Gravi 8 ani în urmă
părinte
comite
cfcc251dc1
1 a modificat fișierele cu 8 adăugiri și 1 ștergeri
  1. 8 1
      generate-repo-stub-readme.sh

+ 8 - 1
generate-repo-stub-readme.sh

@@ -49,11 +49,18 @@ n=$'\n'
 t=$'\t'
 
 travisImage="https://img.shields.io/travis/$travisRepo/master.svg"
-if wget -q --spider "$travisImage" &> /dev/null; then
+if svg="$(wget -qO- "$travisImage" 2>/dev/null)" && [[ "$svg" != *unknown* ]]; then
 	travisLink="https://travis-ci.org/$travisRepo/branches"
 	badges+=( "-${t}[Travis CI:  ${n}${t}![build status badge]($travisImage)]($travisLink)" )
 fi
 
+# https://www.appveyor.com/docs/status-badges/#badges-for-projects-with-public-repositories-on-github-and-bitbucket
+appveyorImage="https://ci.appveyor.com/api/projects/status/github/docker-library/$repo?branch=master&svg=true"
+if svg="$(wget -qO- "$appveyorImage" 2>/dev/null)" && [[ "$svg" != *unknown* ]]; then
+	appveyorLink="https://ci.appveyor.com/project/docker-library/$repo"
+	badges+=( "-${t}[AppVeyor (Windows):  ${n}${t}![build status badge]($appveyorImage)]($appveyorLink)" )
+fi
+
 jenkinsImage="https://doi-janky.infosiftr.net/job/update.sh/job/$repo/badge/icon"
 if wget -q --spider "$jenkinsImage" &> /dev/null; then
 	jenkinsLink="https://doi-janky.infosiftr.net/job/update.sh/job/$repo"