Added UTF-8 BOM detection and removal maintenance scripts

This commit is contained in:
Raphaël Doursenaud 2013-03-01 16:55:07 +01:00
parent 29ccc749ae
commit 72576a26ce
3 changed files with 30 additions and 0 deletions

10
dev/findutf8bom.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# Checks if files contains UTF-8 BOM
# in dolibarr source tree excluding
# git repository, custom modules and incuded libraries
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
grep -rlI \
--exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' \
$'\xEF\xBB\xBF' .

10
dev/findutf8bomincludes.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# Checks if files contains UTF-8 BOM
# in dolibarr includes tree excluding
# git repository
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
grep -rlI \
--exclude-dir='.git' \
$'\xEF\xBB\xBF' htdocs/includes

10
dev/removeutf8bom.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/sh
#
# Removes UTF-8 BOM from a file list on STDIN
# Use by piping the output of a findutf8bom script
#
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
while read f; do
echo "Fixing $f"
sed -i '1s/^\xEF\xBB\xBF//' $f
done