Add a base setup script, update all other scripts with better command run

Commands are set as array and run from them (array unbpack)
This commit is contained in:
2025-07-04 10:14:33 +09:00
parent 8d2731d555
commit 22d18ae4dd
4 changed files with 97 additions and 16 deletions

View File

@@ -1,5 +1,9 @@
#!/usr/bin/env bash
# AUTHOR: Clemens Schwaighofer
# DATE: 2025/6/27
# DESC: create a new basic clone
REPOSITORY="$1";
BRANCH="$2";
REMOTE_HOST="$3";
@@ -16,8 +20,14 @@ if [ -z "${REMOTE_HOST}" ]; then
exit;
fi;
echo "* Validate SSH PEM Key exist and SSH config";
# grep "Host ${REMOTE}"
# grep "IdentityFile" in this
echo "New clone";
echo ${GIT_COMMAND} clone -b "${BRANCH}" --single-branch --depth 1 --origin "${REMOTE}" "${REMOTE_HOST}:${REPOSITORY}" "${GIT_REPOSITORY_FOLDER}${CLONE_BASE}";
GIT_COMMAND=("${GIT_COMMAND_BASE[@]}" "clone" "-b" "${BRANCH}" "--single-branch" "--depth" "1" "--origin" "${REMOTE}" "${REMOTE_HOST}:${REPOSITORY}" "${GIT_REPOSITORY_FOLDER}${CLONE_BASE}")
echo "Command: ${GIT_COMMAND[*]}"
# echo ${GIT_COMMAND_BASE} clone -b "${BRANCH}" --single-branch --depth 1 --origin "${REMOTE}" "${REMOTE_HOST}:${REPOSITORY}" "${GIT_REPOSITORY_FOLDER}${CLONE_BASE}";
# __END__