Skip to content

Commit

Permalink
Ignore non-source files during search
Browse files Browse the repository at this point in the history
  • Loading branch information
marcwrobel committed Aug 1, 2022
1 parent afc3528 commit c20fc6a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions checklinks
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RETRY=1
RETRY_DELAY=10
TIMEOUT=3 # seconds

URL_REGEX='https?://[^][{} "`<>),*$|\\]*[^][{} "`<>),*$|\\.:'"'"']'
EXCLUDED_URLS="https?://(\
localhost|\
old.nabble.com|\
Expand Down Expand Up @@ -33,10 +34,8 @@ NC='\033[0m' # No Color

[ ! -d "$1" ] && echo "'$1' is not a directory" && exit 1

echo "'$EXCLUDED_URLS'"

# Links are processed in a random order to reduce the risk of being blacklisted and temporarily blocked
for url in $(grep -RioEh 'https?://[^][{} "`<>),*$|\\]*[^][{} "`<>),*$|\\.:'"'"']' | sort | uniq | sort -R); do
for url in $(grep -RioEh --exclude-dir={.git,.idea,target,output} --exclude=*.{class,svg} "$URL_REGEX" | sort | uniq | sort -R); do
if [[ "$url" =~ $EXCLUDED_URLS ]]; then
echo -e "${GRAY}$url (IGNORED)${NC}"

Expand Down

0 comments on commit c20fc6a

Please sign in to comment.