From e1a802655a13770cbaf629956232458704ae3576 Mon Sep 17 00:00:00 2001 From: Daniel Wagner-Hall Date: Fri, 20 Oct 2023 17:02:31 +0100 Subject: [PATCH] Expand glob, stop cd-ing in bash --- oci/private/tarball.sh.tpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oci/private/tarball.sh.tpl b/oci/private/tarball.sh.tpl index 8a305b79..0c93d4b8 100644 --- a/oci/private/tarball.sh.tpl +++ b/oci/private/tarball.sh.tpl @@ -6,7 +6,7 @@ readonly STAGING_DIR=$(mktemp -d) readonly YQ="{{yq}}" readonly IMAGE_DIR="{{image_dir}}" readonly BLOBS_DIR="${STAGING_DIR}/blobs" -readonly TARBALL_PATH="$(pwd)/{{tarball_path}}" +readonly TARBALL_PATH="{{tarball_path}}" readonly TAGS_FILE="{{tags}}" readonly INDEX_FILE="${IMAGE_DIR}/index.json" @@ -113,8 +113,7 @@ if [[ "${FORMAT}" == "oci" ]]; then # } repo_tags="${REPOTAGS[@]}" "${YQ}" -o json eval "(.manifests = ${MANIFEST_COPIES}) *d {\"manifests\": (env(repo_tags) | split \" \" | map {\"annotations\": {\"org.opencontainers.image.ref.name\": .}})}" "${INDEX_FILE}" > "${STAGING_DIR}/index.json" - cd "${STAGING_DIR}" - tar -cf "${TARBALL_PATH}" * + tar -C "${STAGING_DIR}" -cf "${TARBALL_PATH}" index.json blobs oci-layout exit 0 fi