Files
garble/scripts/crlf-test.sh
T
2022-12-20 08:53:02 -05:00

21 lines
360 B
Bash
Executable File

#!/bin/bash
if
grep \
--recursive \
--files-with-matches \
--binary \
--binary-files=without-match \
--max-count=1 \
--exclude-dir="\.git" \
$'\r' \
.
then
# TODO exit status should be number of files with wrong endings found
echo -e "Found at least a file with CRLF endings."
exit 1
fi
echo -e "No files with CRLF endings found."
exit 0