From af69cb80200cabbf6db62c9c04d93ddc91c993b2 Mon Sep 17 00:00:00 2001 From: Gregory Haynes Date: Tue, 1 Nov 2016 17:23:58 -0700 Subject: [PATCH] Fail on element-info error If element-info fails we do not detect it due to it being run in a subshell. Whenever this happens it is a terminal error (theres no way we can run without an expanded set of elements) so lets detect and fail early. Change-Id: Ibdeecf19bc2824982273ef5cda6d7b7b614e484e --- lib/common-functions | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/common-functions b/lib/common-functions index f0f007af..cb3a1a9e 100644 --- a/lib/common-functions +++ b/lib/common-functions @@ -228,8 +228,12 @@ function arg_to_elements() { # element=$i # path=${image_elements[$i] # done - eval "$(element-info --env $IMAGE_ELEMENT)" - + elinfo_out="$(element-info --env $IMAGE_ELEMENT)" + if [ $? -ne 0 ]; then + echo "ERROR: element-info failed to expand elements." + exit 1 + fi + eval "$elinfo_out" echo "Expanded element dependencies to: $IMAGE_ELEMENT" }