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}