Skip to main content
summaryrefslogtreecommitdiffstats
blob: 2f5a58c044a3f06b056f9302d86f7f901fc93094 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

# Print out how many of each file extension there is
# find . ! -path "./.git/*" -type f -printf "%f\n"  | sed -E -e 's/.+\./\*./'  | sort -u | while read i; do find . ! -path "./.git/*" -name $i | wc -l | tr -d '\n'; echo " : $i" ; done | sort -n

# Print out all the unique file extensions, including unique names with no extension
# Each of these should be in .gitattributes
# find . ! -path "./.git/*" -type f -printf "%f\n"  | sed -E -e 's/.+\./\*./'  | sort -u

find . ! -path "./.git/*" -type f -printf "%f\n"  | sed -E -e 's/.+\./\\\*\\./'  | sort -u | while read i
do
    echo -n "Checking $i in .gitattributes: "
    if grep "^$i " .gitattributes
    then
        echo "Found"
    else
        echo MISSING $i in .gitattributes. List of file:
        find . ! -path "./.git/*" -type f -name "$i"
        exit 1
    fi
done

Back to the top