From d3b1b427aa221a8d649ebf9e387764dbb66c053b Mon Sep 17 00:00:00 2001 From: Kyle Isom Date: Thu, 13 Apr 2023 09:49:47 -0700 Subject: [PATCH] packer/build-image: fail earlier without a board file. --- packer/build-image.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packer/build-image.sh b/packer/build-image.sh index cb23f18..bfd5825 100755 --- a/packer/build-image.sh +++ b/packer/build-image.sh @@ -30,17 +30,16 @@ preflight () { fi ;; custom) - PACKER_BUILD_FILE="${2:-}" - if [ "${SKIP_LOCAL_CACHE}" != "yes" ] - then - REMOTE_IMAGE_URL="$(jq '.builders[0].file_urls' ${PACKER_BUILD_FILE} | grep https | tr -d ' \",')" - fi - if [ -z "${PACKER_BUILD_FILE}" ] then errmsg "[!] custom board requires a board file path" exit 1 fi + + if [ "${SKIP_LOCAL_CACHE}" != "yes" ] + then + REMOTE_IMAGE_URL="$(jq '.builders[0].file_urls' ${PACKER_BUILD_FILE} | grep https | tr -d ' \",')" + fi ;; *) errmsg "[!] invalid image type ${IMAGE_TYPE}."