Tools/setup/ubuntu.sh: fix GCC_VER_STR failure handling (#22007)

* Fixed an issue where if the GCC_VER_STR would not contain the right NUTTX_GCC_VERSION, the grep -c command would throw a failure, silently exiting the entire ubuntu.sh setup script
This commit is contained in:
Titus 2023-10-19 03:01:07 +02:00 committed by GitHub
parent 68bc90bab5
commit e31e170438
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
source $HOME/.profile # load changed path for the case the script is reran before relogin
if [ $(which arm-none-eabi-gcc) ]; then
GCC_VER_STR=$(arm-none-eabi-gcc --version)
GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}")
GCC_FOUND_VER=$(echo $GCC_VER_STR | grep -c "${NUTTX_GCC_VERSION}" || true)
fi
if [[ "$GCC_FOUND_VER" == "1" ]]; then