diff --git a/scripts/mdlint.sh b/scripts/mdlint.sh index 7194e949cea..a65390588be 100755 --- a/scripts/mdlint.sh +++ b/scripts/mdlint.sh @@ -1,19 +1,20 @@ #! /usr/bin/env bash -set -e +#set -e # use markdownlint-cli to check for markdown files docker run -v ./book:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest '**/*.md' --ignore node_modules + # exit code exit_code=$(echo $?) echo $exit_code if [[ $exit_code == 0 ]]; then echo "All markdown files are properly formatted." - exit $exit_code -else +elif [[ $exit_code == 1 ]]; then + echo "Exiting with exit code $exit_code. Run 'make mdlint' locally and commit the changes." docker run -v ./book:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest '**/*.md' --ignore node_modules --fix - # echo "Exiting with exit code $exit_code. If the exit code is 1, run 'make mdlint' and commit the changes." - exit $exit_code +else + echo "Exiting with exit code >1. Check for the error logs and fix them accordingly." fi