Skip to content

Commit cfcc251

Browse files
committed
Update "generate-repo-stub-readme.sh" to skip "unknown" Travis badges and to include AppVeyor badges where applicable!
1 parent f53d9ef commit cfcc251

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

generate-repo-stub-readme.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,18 @@ n=$'\n'
4949
t=$'\t'
5050

5151
travisImage="https://img.shields.io/travis/$travisRepo/master.svg"
52-
if wget -q --spider "$travisImage" &> /dev/null; then
52+
if svg="$(wget -qO- "$travisImage" 2>/dev/null)" && [[ "$svg" != *unknown* ]]; then
5353
travisLink="https://travis-ci.org/$travisRepo/branches"
5454
badges+=( "-${t}[Travis CI: ${n}${t}![build status badge]($travisImage)]($travisLink)" )
5555
fi
5656

57+
# https://www.appveyor.com/docs/status-badges/#badges-for-projects-with-public-repositories-on-github-and-bitbucket
58+
appveyorImage="https://ci.appveyor.com/api/projects/status/github/docker-library/$repo?branch=master&svg=true"
59+
if svg="$(wget -qO- "$appveyorImage" 2>/dev/null)" && [[ "$svg" != *unknown* ]]; then
60+
appveyorLink="https://ci.appveyor.com/project/docker-library/$repo"
61+
badges+=( "-${t}[AppVeyor (Windows): ${n}${t}![build status badge]($appveyorImage)]($appveyorLink)" )
62+
fi
63+
5764
jenkinsImage="https://doi-janky.infosiftr.net/job/update.sh/job/$repo/badge/icon"
5865
if wget -q --spider "$jenkinsImage" &> /dev/null; then
5966
jenkinsLink="https://doi-janky.infosiftr.net/job/update.sh/job/$repo"

0 commit comments

Comments
 (0)