diff --git a/hack/markdownlint.sh b/hack/markdownlint.sh new file mode 100755 index 000000000..5901d1dd5 --- /dev/null +++ b/hack/markdownlint.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +set -eux + +IS_CONTAINER=${IS_CONTAINER:-false} + +if [ "${IS_CONTAINER}" != "false" ]; then + TOP_DIR="${1:-.}" + find "${TOP_DIR}" -path ./vendor -prune -o -name '*.md' -exec mdl --style all --warnings {} \+ +else + podman run --rm \ + --env IS_CONTAINER=TRUE \ + --volume "${PWD}:/workdir:ro,z" \ + --entrypoint sh \ + --workdir /workdir \ + registry.hub.docker.com/pipelinecomponents/markdownlint:latest \ + /workdir/hack/markdownlint.sh "${@}" +fi;