Tools: fix style consistency in shell scripts "if [...]; then"

This commit is contained in:
Matthias Grob
2019-02-24 16:53:45 +01:00
committed by Daniel Agar
parent c21849b9b5
commit bee1835831
9 changed files with 38 additions and 75 deletions
+2 -3
View File
@@ -25,7 +25,7 @@ else
if [ "$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_1" -a \
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_2" -a \
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_3" -a \
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_4" ];
"$ASTYLE_VER" != "$ASTYLE_VER_REQUIRED_4" ]
then
echo "Error: you're using ${ASTYLE_VER}"
echo "but should be using ${ASTYLE_VER_REQUIRED_1}, ${ASTYLE_VER_REQUIRED_2}, ${ASTYLE_VER_REQUIRED_3}, or ${ASTYLE_VER_REQUIRED_4} instead"
@@ -36,8 +36,7 @@ fi
CI="${CI:-false}"
DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
if [[ "$@" == "--fix" ]]
then
if [[ "$@" == "--fix" ]]; then
export PX4_ASTYLE_FIX=1
fi
+1 -2
View File
@@ -3,8 +3,7 @@ set -eu
PATTERN="-e ."
if [ $# -gt 0 ]
then
if [ $# -gt 0 ]; then
PATTERN="$1"
fi
+1 -2
View File
@@ -48,8 +48,7 @@ fi
# If there are whitespace errors, print the offending file names and fail.
git diff-index --check --cached $against --
if [ $? -ne 0 ]
then
if [ $? -ne 0 ]; then
exit 1
fi