From 734946a7abf4dd0336343d493598257ef117923e Mon Sep 17 00:00:00 2001 From: Lexi Stelter Date: Thu, 25 Feb 2021 18:46:35 +0100 Subject: [PATCH] add bin/find_crlf (shell script to find CRLF line endings) --- bin/find_crlf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 bin/find_crlf diff --git a/bin/find_crlf b/bin/find_crlf new file mode 100755 index 0000000..79217c3 --- /dev/null +++ b/bin/find_crlf @@ -0,0 +1,16 @@ +#!/bin/bash + +EXCLUDES=( + "*/node_modules/*" + "*/.git/*" + "*/__pycache__/*" +) + +EXCLUDE_PARAMS=() + +for path in "${EXCLUDES[@]}"; do + EXCLUDE_PARAMS+=("-not" "-path" "$path") +done + +find . -type f "${EXCLUDE_PARAMS[@]}" -exec file '{}' \; | grep 'CRLF' +