SSH Config creation script, readme update

This commit is contained in:
2025-09-11 15:56:06 +09:00
parent 222cc2594d
commit a780df5422
3 changed files with 76 additions and 3 deletions

View File

@@ -4,10 +4,13 @@
# DATE: 2025/6/27
# DESC: create a new basic clone
# COMMAND: new_clone.sh <Repo.git> <branch> [<host>] [<Repo Target Name>] [<remote name>]
REPOSITORY="$1";
BRANCH="$2";
REMOTE_HOST="$3";
REMOTE_NAME="$4";
REPOSITORY_FOLDER="$4"
REMOTE_NAME="$5";
if [ -z "${REMOTE_NAME}" ]; then
REMOTE_NAME="origin"
fi;
@@ -61,7 +64,11 @@ fi;
unique_id=$(uuidgen | tr -d '-' | head -c 8);
# strip .git from the repository path
GIT_REPOSITORY_NAME=$(basename "${REPOSITORY}" .git);
if [ -z "${REPOSITORY_FOLDER}" ]; then
GIT_REPOSITORY_NAME=$(basename "${REPOSITORY}" .git);
else
GIT_REPOSITORY_NAME="${REPOSITORY_FOLDER}";
fi;
# 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