Skip to content
Snippets Groups Projects

Split check-no-floating.sh into multiple files.

Merged Jan Frenzel requested to merge 479-split-check-no-floating into preview
5 files
+ 108
31
Compare changes
  • Side-by-side
  • Inline
Files
5
#!/bin/bash
scriptpath=${BASH_SOURCE[0]}
basedir=$(dirname "${scriptpath}")
basedir=$(dirname "${basedir}")
DOCUMENT_ROOT=${basedir}/docs
MSG=$(find ${DOCUMENT_ROOT} -name "*.md" | while IFS=' ' read string
do
md=${string#${DOCUMENT_ROOT}/}
# count occurences of md in nav
numberOfReferences=$(sed -n '/nav:/,/^$/p' ${basedir}/mkdocs.yml \
| grep -c ${md})
if [[ ${numberOfReferences} -gt 1 ]]; then
echo "${md} is included ${numberOfReferences} times in nav"
fi
done
)
if [[ ! -z "${MSG}" ]]; then
echo "${MSG}"
exit 1
fi
Loading