Skip to content

Commit

Permalink
test:check-links:fix status code display
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl committed Feb 1, 2020
1 parent 63ce875 commit 8fb1075
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/check-links.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ finder(){ # expects list of files
checker(){ # expects list of urls
errors=0
for url in "$@"; do
case $(curl -IL -w '%{http_code}' -so /dev/null "$url") in
status="$(curl -IL -w '%{http_code}' -so /dev/null "$url")"
case "$status" in
2??)
# success
;;
[45]??)
echo " ERROR:${REPLY}:$url" >&2
echo " ERROR:$status:$url" >&2
errors=$(($errors + 1))
;;
*)
echo " WARNING:${REPLY}:$url" >&2
echo " WARNING:$status:$url" >&2
;;
esac
done
Expand Down

0 comments on commit 8fb1075

Please sign in to comment.