Removing large files; adding hook to watch for them

Этот коммит содержится в:
2022-12-18 22:14:25 -06:00
родитель a34c96df6b
Коммит 0626c66413
29 изменённых файлов: 19 добавлений и 1740 удалений
+4 -3
Просмотреть файл
@@ -17,10 +17,11 @@ function findBadTerm() {
# param term: the term to search for duplicates
file="$1"
term="$2"
results="$(grep "$term:" "$file" | sed 's/\s\+'"$term"':\s*//' | sort)"
results="$(grep -i "$term:" "$file" | tr '[[:upper:]]' '[[:lower:]]' | sed 's/\s+'"$term"':\s*//' | sort | uniq -c | grep -vE '^\s+1\s+' )"
if ! diff <(echo "$results") <(echo "$results" | uniq); then
echo "Some ${term^^} entries are duplicated. Search for the above terms in your inventory and deduplicate."
if [ -n "$results" ]; then
echo "Some ${term} entries are duplicated. Search for the above terms in your inventory and deduplicate."
echo "$results"
exit 2
fi
}