Skip to content

Commit 73d117a

Browse files
authored
Update run_ci.sh
1 parent 207ddb4 commit 73d117a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

scripts/run_ci.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
set -euo pipefail
44

5-
PROJECT_DIR="$(dirname $(readlink -f ${BASH_SOURCE[0]}))/.."
5+
PROJECT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")/.."
66

7-
MD_FILES=$(find ${PROJECT_DIR} -name "*.md" -not -path "${PROJECT_DIR}/tests/*")
8-
9-
for file in ${MD_FILES[@]}; do
10-
python ${PROJECT_DIR}/tests/syntax_lint.py ${file} > /dev/null
7+
# Use the `-print0` option to handle spaces safely, and while-read loop:
8+
find "${PROJECT_DIR}" \
9+
-name "*.md" \
10+
-not -path "${PROJECT_DIR}/tests/*" \
11+
-print0 |
12+
while IFS= read -r -d '' file
13+
do
14+
python "${PROJECT_DIR}/tests/syntax_lint.py" "${file}" > /dev/null
1115
done
1216

1317
echo "- Syntax lint tests on MD files passed successfully"
1418

15-
flake8 --max-line-length=100 . && echo "- PEP8 Passed"
19+
flake8 --max-line-length=100 . && echo "- PEP8 Passed"

0 commit comments

Comments
 (0)