]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/tools/headerstyle.sh
Ensure headers are always #included
[xonotic/xonotic-data.pk3dir.git] / qcsrc / tools / headerstyle.sh
index 7f86db1ee1347eac6874bbd4db5ef924dc6edca3..924083166f08e0650e4c08f624eded6b6835822c 100755 (executable)
@@ -17,7 +17,7 @@ function check() {
     find "$base" -type f -name '*.qc' -print0 | sort -z | while read -r -d '' file; do
         echo "$file"
         declare -l file_h="${file%.qc}.qh"
-        if [ ! -f "$file_h" ]; then echo "#pragma once" > "$file_h"; fi
+        if [[ ! -f "$file_h" ]]; then echo "#pragma once" > "$file_h"; fi
 
         include=$(basename "$file")
         include="${include%.qc}.qh"
@@ -28,21 +28,9 @@ function check() {
         echo "$file"
         startswith "$file" "#pragma once"
     done
-    find "$base" -type f -name '_mod.inc' -print0 | sort -z | while read -r -d '' file; do
-        echo "$file"
-        declare -l file_inc="${file%_mod.inc}_all.inc"
-        if [ ! -f "$file_inc" ]; then
-            echo '#include "_all.qh"' > "$file_inc"
-            echo '#include "_mod.inc"' >> "$file_inc"
-        fi
-        declare -l file_qh="${file%_mod.inc}_all.qh"
-        if [ ! -f "$file_qh" ]; then
-            echo '#pragma once' > "$file_qh"
-            echo '#include "_mod.qh"' >> "$file_qh"
-        fi
-    done
 }
 
 check client
 check server
 check menu
+check common