From 140b42672092c6faeef9ace6b91356942fc4ee61 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Thu, 10 Jul 2025 20:59:19 +0200 Subject: [PATCH] stylecheck script: improve bash consition because of error iwth newer terminal versionsstylecheck script: improve bash condition to avoid error with newer terminal versions (#25193) --- Tools/astyle/check_code_style_all.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/astyle/check_code_style_all.sh b/Tools/astyle/check_code_style_all.sh index c4f4669003..462a1358e3 100755 --- a/Tools/astyle/check_code_style_all.sh +++ b/Tools/astyle/check_code_style_all.sh @@ -43,7 +43,7 @@ fi # install git pre-commit hook HOOK_FILE="$DIR/../../.git/hooks/pre-commit" -if [ ! -f $HOOK_FILE ] && [ "$CI" != "true" ] && [ $- == *i* ]; then +if [[ ! -f "$HOOK_FILE" && "$CI" != "true" && $- == *i* ]]; then echo "" echo -e "\033[31mNinja tip: add a git pre-commit hook to automatically check code style\033[0m" echo -e "Would you like to install one now? (\033[94mcp ./Tools/astyle/pre-commit .git/hooks/pre-commit\033[0m): [y/\033[1mN\033[0m]"