From 83ccc4e61e5dd4d4641d61cb2cf50816099514e1 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Thu, 16 Jan 2020 10:52:19 +0100 Subject: [PATCH] setup: fix script fail if check fails --- Tools/setup/ubuntu.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tools/setup/ubuntu.sh b/Tools/setup/ubuntu.sh index c59cb1ab46..db958d4c91 100755 --- a/Tools/setup/ubuntu.sh +++ b/Tools/setup/ubuntu.sh @@ -143,10 +143,12 @@ if [[ $INSTALL_NUTTX == "true" ]]; then # arm-none-eabi-gcc NUTTX_GCC_VERSION="7-2017-q4-major" +if [ $(which arm-none-eabi-gc) ]; then GCC_VER_STR=$(arm-none-eabi-gcc --version) - STATUSRETVAL=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}") + GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}") +fi - if [ $STATUSRETVAL -eq "1" ]; then + if [ ! ${GCC_FOUND_VER+x} && $GCC_FOUND_VER -eq "1" ]; then echo "arm-none-eabi-gcc-${NUTTX_GCC_VERSION} found, skipping installation" else