Merge pull request #6479 from heitbaum/functions10

[le10] config/functions: improve error message when there in not a device directory
This commit is contained in:
CvH 2022-05-26 15:25:42 +02:00 committed by GitHub
commit 3010b42454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -741,8 +741,15 @@ check_project() {
check_device() {
local dashes="===========================" device_err_msg
if [ \( -z "${DEVICE}" -a -d "${PROJECT_DIR}/${PROJECT}/devices" \) -o \
\( -n "${DEVICE}" -a ! -d "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}" \) ]; then
if [ -n "${DEVICE}" -a ! -d "${PROJECT_DIR}/${PROJECT}/devices" ]; then
device_err_msg="\n $dashes$dashes$dashes"
device_err_msg="${device_err_msg}\n ERROR: You must not specify DEVICE for the $PROJECT project"
device_err_msg="${device_err_msg}\n $dashes$dashes$dashes"
device_err_msg="${device_err_msg}\n\n There are no devices for project: ${PROJECT}"
die "${device_err_msg}"
elif [ \( -z "${DEVICE}" -a -d "${PROJECT_DIR}/${PROJECT}/devices" \) -o \
\( -n "${DEVICE}" -a ! -d "${PROJECT_DIR}/${PROJECT}/devices/${DEVICE}" \) ]; then
device_err_msg="\n $dashes$dashes$dashes"
device_err_msg="${device_err_msg}\n ERROR: You need to specify a valid device for the $PROJECT project"
device_err_msg="${device_err_msg}\n $dashes$dashes$dashes"