2015-06-24 06:59:57 +03:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 Intel, Inc. All rights reserved.
|
2015-08-24 18:24:37 +03:00
|
|
|
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
|
|
|
# reserved
|
2015-09-08 19:35:04 +03:00
|
|
|
# Copyright (c) 2015 Cisco Systems, Inc.
|
2015-06-24 06:59:57 +03:00
|
|
|
# $COPYRIGHT$
|
2015-06-25 23:27:56 +03:00
|
|
|
#
|
2015-06-24 06:59:57 +03:00
|
|
|
# Additional copyrights may follow
|
2015-06-25 23:27:56 +03:00
|
|
|
#
|
2015-06-24 06:59:57 +03:00
|
|
|
# $HEADER$
|
|
|
|
#
|
|
|
|
|
2015-08-24 18:24:37 +03:00
|
|
|
for file in $(git ls-files) ; do
|
|
|
|
# check for the mime-type and do not follow symbolic links. this
|
|
|
|
# will cause file to print application/x-symlink for the mime-type
|
|
|
|
# allowing us to only have to check if the type is application to
|
|
|
|
# skip sym links, pdfs, etc. If any other file types should be
|
|
|
|
# skipped add the check here.
|
|
|
|
type=$(file -b --mime-type -h $file)
|
2015-08-24 18:30:46 +03:00
|
|
|
if test ${type::4} == "text" ; then
|
2015-09-08 19:35:04 +03:00
|
|
|
# Eliminate whitespace at the end of lines
|
|
|
|
perl -pi -e 's/\s*$/\n/' $file
|
2015-08-24 18:24:37 +03:00
|
|
|
fi
|
|
|
|
done
|