Skip to content

Commit

Permalink
Update mdlint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
chong-he committed Apr 12, 2024
1 parent 2fe777c commit f55a92f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions scripts/mdlint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f55a92f

Please sign in to comment.