mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 08:56:40 +00:00
![kleines Filmröllchen](/assets/img/avatar_default.png)
We use the environment variable SERENITY_SOURCE_DIR to resolve and check icon links. This is a bit inconvenient as SERENITY_SOURCE_DIR needs to be set correctly before invoking the markdown checker, but as we use it through the check-markdown script anyways, I think it's not a problem.
27 lines
890 B
Bash
Executable file
27 lines
890 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eo pipefail
|
|
|
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
cd "${script_path}/.."
|
|
|
|
if [ -z "${MARKDOWN_CHECK_BINARY:-}" ] ; then
|
|
if ! [ -d Build/lagom/ ] ; then
|
|
echo "Directory Build/lagom/ does not exist. Skipping markdown check."
|
|
exit 0
|
|
fi
|
|
if ! [ -r Build/lagom/markdown-check ] ; then
|
|
echo "Lagom executable markdown-check was not built. Skipping markdown check."
|
|
echo "To enable this check, you may need to run './Meta/serenity.sh build lagom' first."
|
|
exit 0
|
|
fi
|
|
MARKDOWN_CHECK_BINARY="Build/lagom/markdown-check"
|
|
fi
|
|
|
|
if [ -z "$SERENITY_SOURCE_DIR" ] ; then
|
|
SERENITY_SOURCE_DIR=$(pwd -P)
|
|
export SERENITY_SOURCE_DIR
|
|
fi
|
|
|
|
find AK Base Documentation Kernel Meta Ports Tests Userland -path 'Ports/*/*' -prune -o -type f -name '*.md' -print0 | xargs -0 "${MARKDOWN_CHECK_BINARY}" README.md
|