Skip to content

Commit

Permalink
copying images.json file only if exists (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
pacostas authored Sep 3, 2024
1 parent 531bf32 commit f4f8bcf
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -98,7 +98,6 @@ OPTIONS
USAGE
}


function tools::install() {
util::tools::jam::install \
--directory "${BIN_DIR}"
Expand Down

0 comments on commit f4f8bcf

Please sign in to comment.