Enhance fixutf8bomfiles and fixdosfiles tools.
This commit is contained in:
parent
89365786a8
commit
4208f11d87
@ -1,10 +0,0 @@
|
|||||||
#!/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' .
|
|
||||||
@ -16,13 +16,13 @@ fi
|
|||||||
# To detec
|
# To detec
|
||||||
if [ "x$1" = "xlist" ]
|
if [ "x$1" = "xlist" ]
|
||||||
then
|
then
|
||||||
find . -type f -iname "*.php" -exec file "{}" + | grep CRLF
|
find . -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# To convert
|
# To convert
|
||||||
if [ "x$1" = "xfix" ]
|
if [ "x$1" = "xfix" ]
|
||||||
then
|
then
|
||||||
for fic in `find . -type f -iname "*.php" -exec file "{}" + | grep CRLF | awk -F':' '{ print $1 }' `
|
for fic in `find . -iname "*.php" -o -iname "*.sh" -o -iname "*.pl" -o -iname "*.lang" -o -iname "*.txt" -exec file "{}" + | grep -v 'htdocs\/includes' | grep CRLF | awk -F':' '{ print $1 }' `
|
||||||
do
|
do
|
||||||
echo "Fix file $fic"
|
echo "Fix file $fic"
|
||||||
dos2unix $fic
|
dos2unix $fic
|
||||||
|
|||||||
33
dev/fixutf8bomfiles.sh
Executable file
33
dev/fixutf8bomfiles.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Checks of fix files contains UTF-8 BOM in dolibarr source tree,
|
||||||
|
# excluding git repository, custom modules and included libraries.
|
||||||
|
#
|
||||||
|
# Raphaël Doursenaud - rdoursenaud@gpcsolutions.fr
|
||||||
|
# Laurent Destailleur eldy@users.sourceforge.net
|
||||||
|
#------------------------------------------------------
|
||||||
|
# Usage: fixutf8bomfiles.sh [list|fix]
|
||||||
|
#------------------------------------------------------
|
||||||
|
|
||||||
|
# Syntax
|
||||||
|
if [ "x$1" != "xlist" -a "x$1" != "xfix" ]
|
||||||
|
then
|
||||||
|
echo "Usage: fixutf8bomfiles.sh [list|fix]"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# To detec
|
||||||
|
if [ "x$1" = "xlist" ]
|
||||||
|
then
|
||||||
|
#find . -iname '*.php' -print0 -o -iname '*.sh' -print0 -o -iname '*.pl' -print0 -o -iname '*.lang' -print0 -o -iname '*.txt' -print0 | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
|
||||||
|
grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# To convert
|
||||||
|
if [ "x$1" = "xfix" ]
|
||||||
|
then
|
||||||
|
for fic in `grep -rlIZ --include='*.php' --include='*.sh' --include='*.pl' --include='*.lang' --include='*.txt' --exclude-dir='.git' --exclude-dir='includes' --exclude-dir='custom' . . | xargs -0 awk '/^\xEF\xBB\xBF/ {print FILENAME} {nextfile}'`
|
||||||
|
do
|
||||||
|
echo "Fixing $fic"
|
||||||
|
sed -i '1s/^\xEF\xBB\xBF//' $fic
|
||||||
|
done;
|
||||||
|
fi
|
||||||
@ -1,15 +0,0 @@
|
|||||||
#!/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
|
|
||||||
#
|
|
||||||
# Example:
|
|
||||||
# cd dirwithfiles
|
|
||||||
# ls | /path/dev/removeutf8bom.sh
|
|
||||||
|
|
||||||
while read f; do
|
|
||||||
echo "Fixing $f"
|
|
||||||
sed -i '1s/^\xEF\xBB\xBF//' $f
|
|
||||||
done
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
# Dolibarr language file - pt_PT - admin
|
# Dolibarr language file - pt_PT - admin
|
||||||
CHARSET = UTF-8
|
CHARSET = UTF-8
|
||||||
AccountCodeManager = Módulo de geração dos códigos contabilisticos (Clientes/Fornecedores)
|
AccountCodeManager = Módulo de geração dos códigos contabilisticos (Clientes/Fornecedores)
|
||||||
ActivateFCKeditor = Activar FCKeditor para :
|
ActivateFCKeditor = Activar FCKeditor para :
|
||||||
ActivateOn = Activar sobre
|
ActivateOn = Activar sobre
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user