Skip to content

Commit

Permalink
link-chcker: flip http check logic
Browse files Browse the repository at this point in the history
  • Loading branch information
eiskasten committed Dec 20, 2022
1 parent 1c26be2 commit efe0b0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/link-checker
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TRIES=5

check() {
link=$(echo "$1" | grep -oE "(https|http|ftp):[^|]*")
secure_link=$(echo "$1" | grep -oE "(https|ftp):[^|]*")
http_link=$(echo "$1" | grep -oE "http:[^|]*")
files=$(echo "$1" | grep -oE "\|.*" | sed 's/|/ /g')

if echo "$link" | grep -Eqf "$WHITELIST"; then
Expand All @@ -61,7 +61,7 @@ check() {
echo "check the link format of $1"
return
fi
if [ -z "$secure_link" ]; then
if [ -n "$http_link" ]; then
echo "link $1 is an http link but not whitelisted"
return
fi
Expand Down

0 comments on commit efe0b0a

Please sign in to comment.