From 2c56ceec930f75b28c87a1a87ba77b589c13d913 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Tue, 8 May 2018 17:04:26 +0100 Subject: [PATCH] astyle: switch condition to empty string check Thanks to @bkueang 's review comment I switched to an explicit check for an empty sting instead of a condition that could be theoretically true in other cases and is less readable. Type "man test" on your terminal to read up what -n stands for. --- Tools/astyle/check_code_style.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/astyle/check_code_style.sh b/Tools/astyle/check_code_style.sh index 24ee4565dc..b1154911ba 100755 --- a/Tools/astyle/check_code_style.sh +++ b/Tools/astyle/check_code_style.sh @@ -5,7 +5,7 @@ DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) if [ -f "$FILE" ]; then CHECK_FAILED=$(${DIR}/fix_code_style.sh --dry-run --formatted $FILE) - if [[ $CHECK_FAILED ]]; then + if [ -n "$CHECK_FAILED" ]; then ${DIR}/fix_code_style.sh --quiet < $FILE > $FILE.pretty echo