You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/scripts/crlf-test.sh

20 lines
344 B
Bash

#!/bin/bash
file_count=$(grep \
--recursive \
--files-with-matches \
--binary \
--binary-files=without-match \
--max-count=1 \
--exclude-dir="\.git" \
$'\r' \
. | wc -l)
if [[ $file_count -gt 0 ]]; then
echo -e "Found $file_count file(s) with CRLF endings."
exit "$file_count"
fi
echo -e "No files with CRLF endings found."
exit 0