Skip to content

Commit 654c220

Browse files
authored
Merge pull request #1596 from Martii/cleanupFindbom
Some simplification of dev tool findbom.sh Auto-merge
2 parents 1e8ca74 + 8859d6a commit 654c220

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

dev/findbom.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/bin/bash
22
cd ..
3-
echo "Searching for possible UTF-16 BE BOMs..."
4-
find . -type f -not \( -path "./node_modules/*" \) -not \( -path "./fakeS3/*" \) -print0 | xargs -0r awk '/^\xFE\xFF/ {print FILENAME} {nextfile}'
5-
echo "Searching for possible UTF-16 LE BOMs..."
6-
find . -type f -not \( -path "./node_modules/*" \) -not \( -path "./fakeS3/*" \) -print0 | xargs -0r awk '/^\xFF\xFE/ {print FILENAME} {nextfile}'
3+
echo "Searching for possible non-UTF-8 compatible..."
4+
find . -type f ! \( -path "./.git/*" -o -path "./node_modules/*" -o -path "./S3rver/*" -o -path "./dev/cache/*" \) -exec file --mime {} \; | grep -v 'utf-8\|binary\|ascii'
75
echo "Searching for possible UTF-8 BOMs..."
8-
find . -type f -not \( -path "./node_modules/*" \) -not \( -path "./fakeS3/*" \) -print0 | xargs -0r awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
6+
find . -type f ! \( -path "./.git/*" -o -path "./node_modules/*" -o -path "./S3rver/*" -o -path "./dev/cache/*" \) -print0 | xargs -0r awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
97
cd - > /dev/null

0 commit comments

Comments
 (0)