Skip to content

Commit

Permalink
copying over images.json fil only if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
pacostas committed Sep 10, 2024
1 parent d98b13f commit 64abb69
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions scripts/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ function main() {

tools::install

if [ -f "${IMAGES_JSON}" ]; then
# we need to copy images.json for inclusion in the build image
cp images.json stack
fi

# 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')
Expand Down

0 comments on commit 64abb69

Please sign in to comment.