-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |