summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2013-06-24 21:37:15 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2013-06-24 21:37:15 +0200
commit7c2e955e1552a9c4e412ea2c936be61fc78ba010 (patch)
treeee506dfbec54f998d10c385bde3a1c3fa04e66b2 /tools
parente218dcfdf2c58f8841e7ebd220527d08e870a6d5 (diff)
parentb376486fd74fa02b0297ceef6d0f977b32358e5e (diff)
downloadcolobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.tar.gz
colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.tar.bz2
colobot-7c2e955e1552a9c4e412ea2c936be61fc78ba010.zip
Colobot Gold 0.1.0-alpha
Diffstat (limited to 'tools')
-rwxr-xr-xtools/fix-eof-eol.sh17
-rwxr-xr-xtools/git-grep-braces.sh4
2 files changed, 21 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
diff --git a/tools/git-grep-braces.sh b/tools/git-grep-braces.sh
new file mode 100755
index 0000000..85823ab
--- /dev/null
+++ b/tools/git-grep-braces.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# Finds all "hanging" braces
+git grep -n -E '^( *[^ ]+)+[^@]\{\s*$' -- '*.cpp' '*.h'