Skip to content

Commit 830209b

Browse files
committed
Edit file paths
Signed-off-by: Elena Uziunaite <elena.uziunaite@arm.com>
1 parent ec982b5 commit 830209b

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

scripts/project_detection.sh

+19-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@
1111

1212
# Project detection
1313
read_project_name_file () {
14-
PROJECT_NAME_FILE='../../scripts/project_name.txt'
14+
SCRIPT_DIR=$(pwd)
15+
16+
PROJECT_NAME_FILE="scripts/project_name.txt"
17+
18+
if echo "$SCRIPT_DIR" | grep -q "/framework/scripts" || echo "$SCRIPT_DIR" | grep -q "/tests/scripts"; then
19+
PROJECT_NAME_FILE="../../scripts/project_name.txt"
20+
elif echo "$SCRIPT_DIR" | grep -q "/mbedtls/scripts" || echo "$SCRIPT_DIR" | grep -q "/TF-PSA-Crypto/scripts"; then
21+
PROJECT_NAME_FILE="project_name.txt"
22+
fi
23+
1524
if read -r PROJECT_NAME < "$PROJECT_NAME_FILE"; then :; else
1625
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
1726
exit 1
@@ -30,7 +39,15 @@ in_tf_psa_crypto_repo () {
3039

3140
#Branch detection
3241
read_build_info () {
33-
BUILD_INFO_FILE='../../include/mbedtls/build_info.h'
42+
SCRIPT_DIR=$(pwd)
43+
44+
BUILD_INFO_FILE="include/mbedtls/build_info.h"
45+
46+
if echo "$SCRIPT_DIR" | grep -q "/framework/scripts" || echo "$SCRIPT_DIR" | grep -q "/tests/scripts"; then
47+
BUILD_INFO_FILE="../../include/mbedtls/build_info.h"
48+
elif echo "$SCRIPT_DIR" | grep -q "/mbedtls/scripts"; then
49+
BUILD_INFO_FILE="../include/mbedtls/build_info.h"
50+
fi
3451

3552
if [ ! -f "$BUILD_INFO_FILE" ]; then
3653
echo "File $BUILD_INFO_FILE not found."

0 commit comments

Comments
 (0)