diff --git a/image-builder/Makefile b/image-builder/Makefile index 7998a3f..2579528 100644 --- a/image-builder/Makefile +++ b/image-builder/Makefile @@ -113,7 +113,11 @@ ifeq ($(IMAGE_TYPE), iso) else # Assemble all images based on configs defined in each subdirectory # Trailing / allows proper function with symlinks - iterDirs="$(find $(QCOW_BUNDLE)/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)" + iterDirs="$$(find $(QCOW_BUNDLE)/ -maxdepth 1 -mindepth 1 -type d -exec basename {} \;)" + if [[ -z $$iterDirs ]]; then + echo "Could not find any qcow images defined for bundle - exiting." + exit 1 + fi for subdir in $$iterDirs; do # QCOW configs export osconfig_params="$(QCOW_BUNDLE)/$$subdir/osconfig-vars.yaml" @@ -137,8 +141,12 @@ ifneq ($(QCOW_BUNDLE_DIRS), ) else # Assemble all images based on configs defined in each $(IMAGE_TYPE)* subdirectory # Trailing / allows proper function with symlinks - bundleDirs="$(find $(WORKDIR)/ -maxdepth 1 -mindepth 1 -name "qcow-bundle*" -type d -exec basename {} \;)" + bundleDirs="$$(find $(WORKDIR)/ -maxdepth 1 -mindepth 1 -name "qcow-bundle*" -type d -exec basename {} \;)" endif + if [[ -z $$bundleDirs ]]; then + echo "Could not find any qcow bundle directories - exiting." + exit 1 + fi for bundledir in $$bundleDirs; do export QCOW_BUNDLE="$(WORKDIR)/$$bundledir" sudo -E make cut_image