1
1

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>
Этот коммит содержится в:
Nathan Hjelm 2015-08-24 09:30:46 -06:00
родитель 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