2021-10-04 18:56:33 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -eo pipefail
|
|
|
|
|
|
|
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
|
|
cd "${script_path}/.."
|
|
|
|
|
2021-10-04 19:32:31 +00:00
|
|
|
if [ -z "${MARKDOWN_CHECK_BINARY:-}" ] ; then
|
2021-10-04 18:56:33 +00:00
|
|
|
if ! [ -d Build/lagom/ ] ; then
|
|
|
|
echo "Directory Build/lagom/ does not exist. Skipping markdown check."
|
|
|
|
exit 0
|
|
|
|
fi
|
2023-03-18 15:23:35 +00:00
|
|
|
if ! [ -r Build/lagom/bin/markdown-check ] ; then
|
2021-10-04 18:56:33 +00:00
|
|
|
echo "Lagom executable markdown-check was not built. Skipping markdown check."
|
2024-05-31 23:27:20 +00:00
|
|
|
echo "To enable this check, you may need to run './Meta/ladybird.sh build' first."
|
2021-10-04 18:56:33 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
2023-03-18 15:23:35 +00:00
|
|
|
MARKDOWN_CHECK_BINARY="Build/lagom/bin/markdown-check"
|
2021-10-04 18:56:33 +00:00
|
|
|
fi
|
|
|
|
|
2024-06-03 12:40:19 +00:00
|
|
|
if [ -z "$LADYBIRD_SOURCE_DIR" ] ; then
|
|
|
|
LADYBIRD_SOURCE_DIR=$(pwd -P)
|
|
|
|
export LADYBIRD_SOURCE_DIR
|
2022-02-26 15:51:24 +00:00
|
|
|
fi
|
|
|
|
|
2023-07-02 11:20:23 +00:00
|
|
|
# shellcheck disable=SC2086 # Word splitting is intentional here
|
2024-06-03 12:40:19 +00:00
|
|
|
find AK Base Documentation Meta Tests Userland -path Tests/LibWeb/WPT/wpt -prune -o -type f -name '*.md' -print0 | xargs -0 "${MARKDOWN_CHECK_BINARY}" -b "${LADYBIRD_SOURCE_DIR}/Base" $EXTRA_MARKDOWN_CHECK_ARGS README.md CONTRIBUTING.md
|