blob: ec895d144fde914b349c721472108aa2b8ca47dd [file] [log] [blame]
Martin Roth01b5dd62021-02-17 10:52:55 -07001#!/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
7LC_ALL=C export LC_ALL
8
9EXCLUDE='^3rdparty/\|^payloads/external\|^.git'
10
11# Use git grep if the code is in a git repo, otherwise use grep.
12if [ -n "$(command -v git)" ] && \
13 [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]
14then
15 GREP_FILES="git grep -IlP"
16else
17 GREP_FILES="grep -rIlP"
18fi
19
20${GREP_FILES} "\r$" | grep -v "$EXCLUDE"