Skip to content

Commit

Permalink
Expand glob, stop cd-ing in bash
Browse files Browse the repository at this point in the history
  • Loading branch information
illicitonion committed Oct 20, 2023
1 parent 3a94776 commit e1a8026
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions oci/private/tarball.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e1a8026

Please sign in to comment.