From a8bd4680e8034c3b8eb9b3ebf8e454c092d91b22 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 24 Nov 2015 09:37:53 +0000 Subject: [PATCH] Check for make failure --- src/freedombone-image | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/freedombone-image b/src/freedombone-image index bc9f478c..43bceba3 100755 --- a/src/freedombone-image +++ b/src/freedombone-image @@ -196,6 +196,12 @@ make $IMAGE_TYPE \ SSH_PUBKEY="$SSH_PUBKEY" \ GENERIC_IMAGE="$GENERIC_IMAGE" +if [ ! "$?" = "0" ]; then + echo 'Build failed' + rm -rf $BUILD_DIR + exit 1 +fi + EXPECTED_EXTENSION='img' if [[ $IMAGE_TYPE == "qemu"* ]]; then EXPECTED_EXTENSION='qcow2' @@ -209,7 +215,7 @@ imgfiles=(build/${PROJECT_NAME}*.${EXPECTED_EXTENSION}) if [ ${#imgfiles[@]} -eq 0 ]; then echo 'Image was not created' rm -rf $BUILD_DIR - exit 1 + exit 2 fi mv build/${PROJECT_NAME}*.bz2 ${CURR_DIR}