From de744948e7471f53e9dae5eae8e9361a9ebdb019 Mon Sep 17 00:00:00 2001 From: Russell Bryant Date: Wed, 9 Oct 2019 15:33:22 -0400 Subject: [PATCH] Add hack/markdownlint.sh. --- hack/markdownlint.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 hack/markdownlint.sh 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;