X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Ftools%2Fheaderstyle.sh;h=924083166f08e0650e4c08f624eded6b6835822c;hb=5617c3cbf833ed6feb25402cb1904984432d2b6e;hp=b638927bf4a50441d0adef391b4f48101337cef6;hpb=fc15d72b041c9a748b605ba28735380fbe5b5b01;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/tools/headerstyle.sh b/qcsrc/tools/headerstyle.sh index b638927bf..924083166 100755 --- a/qcsrc/tools/headerstyle.sh +++ b/qcsrc/tools/headerstyle.sh @@ -1,6 +1,6 @@ -#!/bin/bash +#!/usr/bin/env bash set -eu -cd "$(dirname "$0")" +cd ${0%/*} cd .. function startswith() { @@ -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" @@ -33,3 +33,4 @@ function check() { check client check server check menu +check common