Simplify whitespace purge script a little.
Do not need to test with -f. If directories ever show up in git ls-files (unlikely) their mime type is application/x-directory which will fail the test ${file::4} == text check. Signed-off-by: Nathan Hjelm <hjelmn@lanl.gov>
Этот коммит содержится в:
родитель
92ec9ca2bb
Коммит
b4fcd3897e
@ -17,7 +17,7 @@ for file in $(git ls-files) ; do
|
||||
# skip sym links, pdfs, etc. If any other file types should be
|
||||
# skipped add the check here.
|
||||
type=$(file -b --mime-type -h $file)
|
||||
if test -f $file && test ${type::4} == "text" ; then
|
||||
if test ${type::4} == "text" ; then
|
||||
LC_ALL=C sed -i '' -E "s/[[:space:]]*$//" $file
|
||||
fi
|
||||
done
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user