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}")