]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Move {CS,SV,MENU}QC to printf argument for better alignment
authordrjaska <drjaska83@gmail.com>
Thu, 22 Aug 2024 04:56:01 +0000 (07:56 +0300)
committerdrjaska <drjaska83@gmail.com>
Thu, 22 Aug 2024 04:56:21 +0000 (07:56 +0300)
qcsrc/tools/genmod.sh

index 781a37b0d8fa931978a490ddbde41827ebf6b489..5dfb5210ee66d333f14d11573466d04a2e376ce7 100755 (executable)
@@ -43,15 +43,15 @@ function genmod() {
                # skip .qc files
                if [[ "$f" != *.qc ]];        then continue; fi
 
-               if [[ -f "$f" ]];             then printf "#include <%s>\n"                            "${CTX}$f"             >> ${MOD}.inc; fi
-               if [[ -f "${f%.qc}.qh" ]];    then printf "#include <%s>\n"                            "${CTX}${f%.qc}.qh"    >> ${MOD}.qh;  fi
-
-               if [[ -f "cl_$f" ]];          then printf "#ifdef CSQC\n        #include <%s>\n#endif\n"   "${CTX}cl_$f"          >> ${MOD}.inc; fi
-               if [[ -f "cl_${f%.qc}.qh" ]]; then printf "#ifdef CSQC\n        #include <%s>\n#endif\n"   "${CTX}cl_${f%.qc}.qh" >> ${MOD}.qh;  fi
-               if [[ -f "sv_$f" ]];          then printf "#ifdef SVQC\n        #include <%s>\n#endif\n"   "${CTX}sv_$f"          >> ${MOD}.inc; fi
-               if [[ -f "sv_${f%.qc}.qh" ]]; then printf "#ifdef SVQC\n        #include <%s>\n#endif\n"   "${CTX}sv_${f%.qc}.qh" >> ${MOD}.qh;  fi
-               if [[ -f "ui_$f" ]];          then printf "#ifdef MENUQC\n      #include <%s>\n#endif\n" "${CTX}ui_$f"          >> ${MOD}.inc; fi
-               if [[ -f "ui_${f%.qc}.qh" ]]; then printf "#ifdef MENUQC\n      #include <%s>\n#endif\n" "${CTX}ui_${f%.qc}.qh" >> ${MOD}.qh;  fi
+               if [[ -f "$f" ]];             then printf "#include <%s>\n" "${CTX}$f"          >> ${MOD}.inc; fi
+               if [[ -f "${f%.qc}.qh" ]];    then printf "#include <%s>\n" "${CTX}${f%.qc}.qh" >> ${MOD}.qh;  fi
+
+               if [[ -f "cl_$f" ]];          then printf "#ifdef %s\n\t#include <%s>\n#endif\n"   CSQC "${CTX}cl_$f"          >> ${MOD}.inc; fi
+               if [[ -f "cl_${f%.qc}.qh" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n"   CSQC "${CTX}cl_${f%.qc}.qh" >> ${MOD}.qh;  fi
+               if [[ -f "sv_$f" ]];          then printf "#ifdef %s\n\t#include <%s>\n#endif\n"   SVQC "${CTX}sv_$f"          >> ${MOD}.inc; fi
+               if [[ -f "sv_${f%.qc}.qh" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n"   SVQC "${CTX}sv_${f%.qc}.qh" >> ${MOD}.qh;  fi
+               if [[ -f "ui_$f" ]];          then printf "#ifdef %s\n\t#include <%s>\n#endif\n" MENUQC "${CTX}ui_$f"          >> ${MOD}.inc; fi
+               if [[ -f "ui_${f%.qc}.qh" ]]; then printf "#ifdef %s\n\t#include <%s>\n#endif\n" MENUQC "${CTX}ui_${f%.qc}.qh" >> ${MOD}.qh;  fi
        done
 
        declare -l rec=1