From f55a92fb915b8c7061df9d38c2e4c7f57aa56873 Mon Sep 17 00:00:00 2001 From: chonghe Date: Fri, 12 Apr 2024 08:43:42 +0800 Subject: [PATCH] Update mdlint.sh --- scripts/mdlint.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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