0
mirror of https://github.com/OneOfEleven/uv-k5-firmware-custom.git synced 2025-04-30 23:31:25 +03:00

26 lines
617 B
Bash
Raw Normal View History

2023-09-09 08:03:56 +01:00
#!/bin/bash
linkchecker -F csv --check-extern $1
OFS=$IFS
IFS=$'\n'
for line in $(grep -E '^[^#]' linkchecker-out.csv | tail -n +2); do
link=$(echo $line | cut -d';' -f 1)
file=$(echo $line | cut -d';' -f 2)
msg=$(echo $line | cut -d';' -f 4)
src=$(echo $file | sed -E 's/file:\/\/(.*)\/Documentation\/(\w+)\/.*/\1\/DoxyGen\/\2/')
if [ -d $src ]; then
origin=$(grep -Ern "href=['\"]${link}['\"]" $src/src/)
for o in $origin; do
ofile=$(echo $o | cut -d':' -f 1)
oline=$(echo $o | cut -d':' -f 2)
echo "${ofile}:${oline};${link};${msg}" >&2
done
fi
done
IFS=$OFS
exit 0