Martin Roth | 01b5dd6 | 2021-02-17 10:52:55 -0700 | [diff] [blame] | 1 | #!/usr/bin/env sh |
| 2 | # |
| 3 | # SPDX-License-Identifier: GPL-2.0-only |
| 4 | |
| 5 | # DESCR: Verify that files don't contain windows line endings |
| 6 | |
| 7 | LC_ALL=C export LC_ALL |
| 8 | |
| 9 | EXCLUDE='^3rdparty/\|^payloads/external\|^.git' |
| 10 | |
| 11 | # Use git grep if the code is in a git repo, otherwise use grep. |
| 12 | if [ -n "$(command -v git)" ] && \ |
| 13 | [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] |
| 14 | then |
| 15 | GREP_FILES="git grep -IlP" |
| 16 | else |
| 17 | GREP_FILES="grep -rIlP" |
| 18 | fi |
| 19 | |
| 20 | ${GREP_FILES} "\r$" | grep -v "$EXCLUDE" |