From b4ab31a2bac2b069528d56740901b3d69d2f2227 Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Tue, 8 Jul 2014 19:11:28 +0200 Subject: [PATCH 1/2] A more compatible way of checking for an empty string. --- Tools/check_submodules.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/check_submodules.sh b/Tools/check_submodules.sh index fb180ef47e..086b6f35d9 100755 --- a/Tools/check_submodules.sh +++ b/Tools/check_submodules.sh @@ -3,7 +3,7 @@ if [ -d NuttX/nuttx ]; then STATUSRETVAL=$(git status --porcelain | grep -i "NuttX") - if [ "$STATUSRETVAL" == "" ]; then + if [ -z $STATUSRETVAL ]; then echo "Checked NuttX submodule, correct version found" else echo "NuttX sub repo not at correct version. Try 'make updatesubmodules'" @@ -19,7 +19,7 @@ fi if [ -d mavlink/include/mavlink/v1.0 ]; then STATUSRETVAL=$(git status --porcelain | grep -i "mavlink/include/mavlink/v1.0") - if [ "$STATUSRETVAL" == "" ]; then + if [ -z $STATUSRETVAL ]; then echo "Checked mavlink submodule, correct version found" else echo "mavlink sub repo not at correct version. Try 'make updatesubmodules'" From 13b41a2629ddf964951eb228534c5a9680a0f100 Mon Sep 17 00:00:00 2001 From: Simon Wilks Date: Tue, 8 Jul 2014 19:17:25 +0200 Subject: [PATCH 2/2] Add quotes around the variable. It's safer. --- Tools/check_submodules.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/check_submodules.sh b/Tools/check_submodules.sh index 086b6f35d9..db81ed04a7 100755 --- a/Tools/check_submodules.sh +++ b/Tools/check_submodules.sh @@ -3,7 +3,7 @@ if [ -d NuttX/nuttx ]; then STATUSRETVAL=$(git status --porcelain | grep -i "NuttX") - if [ -z $STATUSRETVAL ]; then + if [ -z "$STATUSRETVAL" ]; then echo "Checked NuttX submodule, correct version found" else echo "NuttX sub repo not at correct version. Try 'make updatesubmodules'" @@ -19,7 +19,7 @@ fi if [ -d mavlink/include/mavlink/v1.0 ]; then STATUSRETVAL=$(git status --porcelain | grep -i "mavlink/include/mavlink/v1.0") - if [ -z $STATUSRETVAL ]; then + if [ -z "$STATUSRETVAL" ]; then echo "Checked mavlink submodule, correct version found" else echo "mavlink sub repo not at correct version. Try 'make updatesubmodules'"