mirror of
https://github.com/YunoHost/doc.git
synced 2024-09-03 20:06:26 +02:00
96af536f0c
This fixes a potential leftover from the original translation. Other changes: - Some Travis-reported errors are also fixed as a result, this helps lowering the associated failure count. - The dead_links.sh script error message is improved to better pinpoint the kind of reported error (Markdown vs HTML link).
19 lines
784 B
Bash
19 lines
784 B
Bash
returncode=0
|
|
|
|
# Find all markdown links and generate a list of filename.md:N:linktarget (with N the line number)
|
|
for LINK in $(grep -nr -o -E "\]\(\/?(\w|-)+\)" ./*.md | tr -d ']()/')
|
|
do
|
|
PAGE=$(echo $LINK | awk -F: '{print $3}')
|
|
[ -e "$PAGE.md" ] || echo "This Markdown link looks dead (page doesn't exist in english?) $LINK"
|
|
[ -e "$PAGE.md" ] || returncode=1
|
|
done
|
|
|
|
# Find all HTML/href links and generate a list of filename.md:N:linktarget (with N the line number)
|
|
for LINK in $(grep -nr -o -E 'href="\/?(\w|-)+\"' ./*.md | sed -E 's@href="/?@@g' | tr -d '"')
|
|
do
|
|
PAGE=$(echo $LINK | awk -F: '{print $3}')
|
|
[ -e "$PAGE.md" ] || echo "This HTML link looks dead (page doesn't exist in english?) $LINK"
|
|
[ -e "$PAGE.md" ] || returncode=1
|
|
done
|
|
|
|
exit $returncode
|