Skip to content

Commit

Permalink
Merge pull request #17 from cytopia/release-0.10
Browse files Browse the repository at this point in the history
Fix display of errored links
  • Loading branch information
cytopia authored Nov 9, 2018
2 parents 52733c4 + 7004a8b commit 1f6d041
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linkcheck
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ FOLLOW_REDIRECT=""
###
URL_REGEX="http(s)?:\\/\\/[-+%=?&():,._/#0-9a-zA-Z]+"

MY_VERSION="v0.9"
MY_VERSION="v0.10"


############################################################
Expand Down Expand Up @@ -259,8 +259,8 @@ probe_urls() {

if ! echo "${stat}" | tail -1 | grep -qE "${status_codes}"; then
# Fix error line for multiline (in case of redirects via -l option)
line="$( echo "${line}" | paste -sd "," | sed 's/,/ -> /g' )"
printf "\\r\\e[0;31m[ERR]\\e[0m %s \\e[0;31m%s\\e[0m\\n" "${url}" "${line}"
line="$( echo "${line}" | paste -sd "," | sed 's/,/ -> /g' | head -1 | xargs )"
printf "\\r\\e[0;31m[ERR]\\e[0m %s \\e[0;31m[%s]\\e[0m\\n" "${url}" "${line}"
ret_code=1
else
# Fix status code for multiline (in case of redirects via -l option)
Expand Down

0 comments on commit 1f6d041

Please sign in to comment.