From f4f8bcf76ddfe0d4b246d465465ed4c84829ea3f Mon Sep 17 00:00:00 2001 From: Costas Papastathis Date: Tue, 3 Sep 2024 19:22:29 +0300 Subject: [PATCH] copying images.json file only if exists (#100) --- scripts/create.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/create.sh b/scripts/create.sh index 7573ebf..06a7035 100755 --- a/scripts/create.sh +++ b/scripts/create.sh @@ -64,15 +64,15 @@ function main() { tools::install - # we need to copy images.json for inclusion in the build image - cp images.json stack - # if stack or build argument is provided but not both, then throw an error if [[ -n "${stack_dir_name}" && ! -n "${build_dir_name}" ]] || [[ ! -n "${stack_dir_name}" && -n "${build_dir_name}" ]]; then util::print::error "Both stack-dir and build-dir must be provided" elif [[ -n "${stack_dir_name}" && -n "${build_dir_name}" ]]; then stack::create "${ROOT_DIR}/${stack_dir_name}" "${ROOT_DIR}/${build_dir_name}" "${flags[@]}" elif [ -f "${IMAGES_JSON}" ]; then + # we need to copy images.json for inclusion in the build image + cp images.json stack + jq -c '.images[]' "${IMAGES_JSON}" | while read -r image; do config_dir=$(echo "${image}" | jq -r '.config_dir') output_dir=$(echo "${image}" | jq -r '.output_dir') @@ -98,7 +98,6 @@ OPTIONS USAGE } - function tools::install() { util::tools::jam::install \ --directory "${BIN_DIR}"