diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2013-05-26 17:47:54 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2013-05-27 10:19:16 +0200 |
commit | 8765d58b02c9afd00186bae4a0045dff32f7d102 (patch) | |
tree | 884cd72d4b8b2fabbd109001412e315aa908b0e8 /tools/fix-eof-eol.sh | |
parent | 538745a731d07facd7a1574c04a5d34d23ce3bfa (diff) | |
download | colobot-8765d58b02c9afd00186bae4a0045dff32f7d102.tar.gz colobot-8765d58b02c9afd00186bae4a0045dff32f7d102.tar.bz2 colobot-8765d58b02c9afd00186bae4a0045dff32f7d102.zip |
Fixed code formatting
* moved braces to new lines
* fixed some function/variable names
* fixed whitespace issues
Diffstat (limited to 'tools/fix-eof-eol.sh')
-rwxr-xr-x | tools/fix-eof-eol.sh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/fix-eof-eol.sh b/tools/fix-eof-eol.sh new file mode 100755 index 0000000..a077c85 --- /dev/null +++ b/tools/fix-eof-eol.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Formats files to have one newline at the end of file + +for file in $@; do +awk '/^$/ { ws++; next; } + +{ + for (i = 0; i < ws; ++i) { print ""; } + print $0; + ws = 0; +} + +END { + print ""; +}' $file > ${file}.out && mv ${file}.out $file +done |