From ba2c207cceb49bb5822610920208795660383d5d Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Wed, 9 Jul 2025 14:23:44 +0900 Subject: [PATCH] Fix clone log folder --- src/bin/new_clone.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/new_clone.sh b/src/bin/new_clone.sh index 600fc65..65eac03 100755 --- a/src/bin/new_clone.sh +++ b/src/bin/new_clone.sh @@ -60,9 +60,11 @@ fi; unique_id=$(uuidgen | tr -d '-' | head -c 8); -LOG_FILE="${GIT_WEBHOOK_BASE_FOLDER}${LOG_FOLDER}${REPOSITORY}.log"; -# from the repository get the last path without the .git so we have the target folder +# strip .git from the repository path GIT_REPOSITORY_NAME=$(basename "${REPOSITORY}" .git); +# log folder target +LOG_FILE="${GIT_WEBHOOK_BASE_FOLDER}${LOG_FOLDER}${GIT_REPOSITORY_NAME}.log"; +# from the repository get the last path without the .git so we have the target folder echo "[$(date +"%Y-%m-%d %H:%M:%S")] [${unique_id}] [START] New clone from ${REMOTE_HOST}:${REPOSITORY}::${BRANCH} into ${GIT_REPOSITORY_NAME}" | tee -a "$LOG_FILE"; # clone everything GIT_COMMAND=("${GIT_COMMAND_BASE[@]}" "clone" "-b" "${BRANCH}" "--single-branch" "--depth" "1" "--origin" "${REMOTE_NAME}" "${REMOTE_HOST}:${REPOSITORY}" "${GIT_WEBHOOK_BASE_FOLDER}${CLONE_BASE}${GIT_REPOSITORY_NAME}")