Check for file at script startup

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
Thomas Daubney 2024-07-30 15:52:58 +01:00
parent b991ac2d90
commit bda3e46846
2 changed files with 11 additions and 15 deletions

View File

@ -32,13 +32,13 @@ set -eu
# Project detection
PROJECT_NAME_FILE='./scripts/project_name.txt'
if read -r PROJECT_NAME < "$PROJECT_NAME_FILE"; then :; else
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
exit 1
fi
in_mbedtls_repo () {
if [ ! -f $PROJECT_NAME_FILE ]; then
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
exit 1
fi
grep -Fxq "Mbed TLS" "$PROJECT_NAME_FILE"
test "$PROJECT_NAME" = "Mbed TLS"
}
# Collect stats and build a HTML report.

View File

@ -117,21 +117,17 @@ shopt -s extglob
# For project detection
PROJECT_NAME_FILE='./scripts/project_name.txt'
if read -r PROJECT_NAME < "$PROJECT_NAME_FILE"; then :; else
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
exit 1
fi
in_mbedtls_repo () {
if [ ! -f $PROJECT_NAME_FILE ]; then
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
exit 1
fi
grep -Fxq "Mbed TLS" "$PROJECT_NAME_FILE"
test "$PROJECT_NAME" = "Mbed TLS"
}
in_tf_psa_crypto_repo () {
if [ ! -f $PROJECT_NAME_FILE ]; then
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
exit 1
fi
grep -Fxq "TF-PSA-Crypto" "$PROJECT_NAME_FILE"
test "$PROJECT_NAME" = "TF-PSA-Crypto"
}
pre_check_environment () {