#!/usr/bin/env bash
echo "Lint Markdown"
if command -v markdownlint >/dev/null 2>&1; then
    # TODO: 'Documentation/**/*.md'
    markdownlint 'web/content/**/*.md' || ((ERROR_RESULTS++))
else
    echo "markdownlint is missing, please install it from https://github.com/igorshubovych/markdownlint-cli#installation"
fi
if [ "${ERROR_RESULTS}" -ne 0 ]; then
    echo "✖ ${ERROR_RESULTS} markdownlint failed. Review the log carefully to see full listing."
    exit 1
else
    echo "✔ markdownlint passed"
    exit 0
fi
