From 9e37f72c0a8b0114d38a2dfd30912b3f7a62b1e7 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Tue, 3 May 2022 15:56:04 +0200 Subject: [PATCH] fix: extract repo dir --- createrepo.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/createrepo.sh b/createrepo.sh index 933920b..0e6455a 100644 --- a/createrepo.sh +++ b/createrepo.sh @@ -8,9 +8,12 @@ CREATEREPO_IMAGE_VERSION=0.17.2 CUSTOM_UID=$(getent passwd ${USER} | cut -d ':' -f 3) CUSTOM_GID=$(getent passwd ${USER} | cut -d ':' -f 4) +# Extract last element of passed arguments +REPO_DIR=${@: -1} + ${CONTAINER_RUNTIME} run \ --rm \ - --volume ${PWD}:${PWD} \ - --workdir ${PWD} \ + --volume ${REPO_DIR}:${REPO_DIR} \ + --workdir ${REPO_DIR} \ --user ${CUSTOM_UID}:${CUSTOM_GID} \ docker.io/volkerraschek/createrepo:${CREATEREPO_IMAGE_VERSION} ${@}