diff options
-rw-r--r-- | tabs-to-spaces.sh | 2 | ||||
-rw-r--r-- | unix2dos.py | 15 |
2 files changed, 17 insertions, 0 deletions
diff --git a/tabs-to-spaces.sh b/tabs-to-spaces.sh index 0f9ddd0d2..1e52ad850 100644 --- a/tabs-to-spaces.sh +++ b/tabs-to-spaces.sh @@ -3,3 +3,5 @@ find Duplicati -type f -name *.js -exec sed -i '' $'s/\t/ /g' {} + find Duplicati -type f -name *.css -exec sed -i '' $'s/\t/ /g' {} + find Duplicati -type f -name *.cs -exec sed -i '' $'s/\t/ /g' {} + find Duplicati -type f -name *.txt -exec sed -i '' $'s/\t/ /g' {} + + +find Duplicati -type f -name *.cs | xargs python unix2dos.py diff --git a/unix2dos.py b/unix2dos.py new file mode 100644 index 000000000..517955040 --- /dev/null +++ b/unix2dos.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import sys + +for fname in sys.argv[1:]: + infile = open( fname, "rb" ) + instr = infile.read() + infile.close() + outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" ).replace( "\n", "\r\n" ) + + if len(outstr) == len(instr): + continue + + outfile = open( fname, "wb" ) + outfile.write( outstr ) + outfile.close() |