SSH Config creation script, readme update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user