Fix check-rst-files hook to work cross-platform

This commit is contained in:
paschal533
2025-05-08 21:40:18 +01:00
committed by Paul Robinson
parent 6064c96563
commit dc2f77ccbd

View File

@ -55,7 +55,7 @@ repos:
hooks:
- id: check-rst-files
name: Check for .rst files in the top-level directory
entry: sh -c 'ls *.rst 1>/dev/null 2>&1 && { echo "found .rst file in top-level folder"; exit 1; } || exit 0'
entry: python -c "import glob, sys; rst_files = glob.glob('*.rst'); sys.exit(1) if rst_files else sys.exit(0)"
language: system
always_run: true
pass_filenames: false