Only match files tracked by git
All checks were successful
continuous-integration/drone/pr Build is passing

This commit is contained in:
delliott 2024-08-06 14:26:51 +02:00
parent 13af3abe94
commit 519623e5f0
Signed by: delliott
SSH Key Fingerprint: SHA256:h5IC6Ec/o6ypmpM7ZdRqULGyG8dz4Jr5K192BAWAjoo

View File

@ -7,7 +7,7 @@ set -euo pipefail
# =============================================================================
deperrors=''
for depend in xmllint find cat read wc; do
for depend in git grep xmllint find cat read wc; do
if ! command -v "$depend" >/dev/null 2>&1; then
deperrors="$depend $deperrors"
fi
@ -21,7 +21,7 @@ if [ -n "$deperrors" ]; then
EOF
exit 1
fi >>/dev/stderr
all_files="$(find . -type f \( -iname "*\.xml" -o -iname "*\.xsl" -o -iname "*\.xhtml" \))"
all_files="$(git ls-files | grep '\.xml\|\.xsl\|\.xhtml')"
style_class_files="$(
echo "$all_files" | while read -r file; do
if xmllint --xpath "//style" "${file}" &>/dev/null; then