From 6a864dc5feb9392d3a85424951e813e1e5bb595b Mon Sep 17 00:00:00 2001 From: Thomas Daubney Date: Fri, 26 Jul 2024 17:31:46 +0100 Subject: [PATCH] Add check for existence of project name file Signed-off-by: Thomas Daubney --- scripts/lcov.sh | 6 +++++- tests/scripts/all.sh | 10 +++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/lcov.sh b/scripts/lcov.sh index faf14f34e8..15b13c10ee 100755 --- a/scripts/lcov.sh +++ b/scripts/lcov.sh @@ -34,8 +34,12 @@ set -eu PROJECT_NAME_FILE='./scripts/project_name.txt' in_mbedtls_repo () { + if [ ! -f $PROJECT_NAME_FILE ]; then + echo "$PROJECT_NAME_FILE does not exist... Exiting..." + exit 1 + fi grep -Fxq "Mbed TLS" "$PROJECT_NAME_FILE" - } +} # Collect stats and build a HTML report. lcov_library_report () { diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 03c9d321f8..fdd7b946e2 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -119,10 +119,18 @@ shopt -s extglob PROJECT_NAME_FILE='./scripts/project_name.txt' in_mbedtls_repo () { + if [ ! -f $PROJECT_NAME_FILE ]; then + echo "$PROJECT_NAME_FILE does not exist... Exiting..." + exit 1 + fi grep -Fxq "Mbed TLS" "$PROJECT_NAME_FILE" -} + } in_tf_psa_crypto_repo () { + if [ ! -f $PROJECT_NAME_FILE ]; then + echo "$PROJECT_NAME_FILE does not exist... Exiting..." + exit 1 + fi grep -Fxq "TF-PSA-Crypto" "$PROJECT_NAME_FILE" }