mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-26 17:36:40 +08:00
Tools: fix style consistency in shell scripts "if [...]; then"
This commit is contained in:
committed by
Daniel Agar
parent
c21849b9b5
commit
bee1835831
@@ -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
|
||||
|
||||
|
||||
@@ -3,8 +3,7 @@ set -eu
|
||||
|
||||
PATTERN="-e ."
|
||||
|
||||
if [ $# -gt 0 ]
|
||||
then
|
||||
if [ $# -gt 0 ]; then
|
||||
PATTERN="$1"
|
||||
fi
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user