Skip to content

Commit

Permalink
Workflows: update to line endings check
Browse files Browse the repository at this point in the history
  • Loading branch information
rmcdermo committed Aug 8, 2023
1 parent c485cf6 commit 0a5ee31
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/Line_Endings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ jobs:

- name: Check for CFLF line endings
run: |
N_CRLF_FILES=$(grep -rl $'\r$' * > tmp.txt && cat tmp.txt | wc -l)
echo $N_CRLF_FILES
if [$N_CRLF_FILES -gt 0]
then
echo "FAIL: Windows (CRLF) line endings detected!"
grep -IURl --exclude={"*.pdf","*.png"} --exclude-dir=".git" --exclude-dir="output" $'\r' > $crlf_temp
nlines=`cat $crlf_temp | wc -l`
if [ $nlines -gt 0 ]; then
echo "matl-db repo text files with dos line endings:"
cat $crlf_temp
exit 1
else
echo "PASS: Unix (LF) line endings only"
fi
Expand Down

0 comments on commit 0a5ee31

Please sign in to comment.