mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 00:03:33 +08:00
Tools: fix style consistency in shell scripts "if [...]; then"
This commit is contained in:
committed by
Daniel Agar
parent
c21849b9b5
commit
bee1835831
@@ -3,12 +3,10 @@
|
||||
function check_git_submodule {
|
||||
|
||||
# The .git exists in a submodule if init and update have been done.
|
||||
if [[ -f $1"/.git" || -d $1"/.git" ]];
|
||||
then
|
||||
if [[ -f $1"/.git" || -d $1"/.git" ]]; then
|
||||
|
||||
# CI environment always update
|
||||
if [ "$CI" == "true" ];
|
||||
then
|
||||
if [ "$CI" == "true" ]; then
|
||||
git submodule --quiet sync --recursive -- $1
|
||||
git submodule --quiet update --init --recursive -- $1 || true
|
||||
git submodule --quiet update --init --recursive -- $1
|
||||
@@ -17,8 +15,7 @@ then
|
||||
|
||||
SUBMODULE_STATUS=$(git submodule summary "$1")
|
||||
STATUSRETVAL=$(echo $SUBMODULE_STATUS | grep -A20 -i "$1")
|
||||
if ! [[ -z "$STATUSRETVAL" ]];
|
||||
then
|
||||
if ! [[ -z "$STATUSRETVAL" ]]; then
|
||||
echo -e "\033[31mChecked $1 submodule, ACTION REQUIRED:\033[0m"
|
||||
echo ""
|
||||
echo -e "Different commits:"
|
||||
@@ -39,11 +36,9 @@ then
|
||||
echo -e " Use \033[94mgit add $1 && git commit -m 'Updated $1'\033[0m to choose this version (careful!)"
|
||||
echo ""
|
||||
read user_cmd
|
||||
if [ "$user_cmd" == "y" ]
|
||||
then
|
||||
if [ "$user_cmd" == "y" ]; then
|
||||
echo "Continuing build with manually overridden submodule.."
|
||||
elif [ "$user_cmd" == "u" ]
|
||||
then
|
||||
elif [ "$user_cmd" == "u" ]; then
|
||||
git submodule sync --recursive -- $1
|
||||
git submodule update --init --recursive -- $1 || true
|
||||
git submodule update --init --recursive --force -- $1
|
||||
@@ -62,8 +57,7 @@ fi
|
||||
}
|
||||
|
||||
# If called with a path then respect $GIT_SUBMODULES_ARE_EVIL but do normal processing
|
||||
if [ "$#" != "0" ];
|
||||
then
|
||||
if [ "$#" != "0" ]; then
|
||||
# called with a path then process only that path but respect $GIT_SUBMODULES_ARE_EVIL
|
||||
[ -n "$GIT_SUBMODULES_ARE_EVIL" ] && {
|
||||
# GIT_SUBMODULES_ARE_EVIL is set, meaning user doesn't want submodules updated
|
||||
|
||||
Reference in New Issue
Block a user