Basic script check in

This is not completed and under development
This commit is contained in:
2025-06-27 19:06:35 +09:00
commit 8d2731d555
6 changed files with 120 additions and 0 deletions

23
bin/new_clone.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/usr/bin/env bash
REPOSITORY="$1";
BRANCH="$2";
REMOTE_HOST="$3";
REMOTE="$4";
if [ -n "${REMOTE}" ]; then
REMOTE="origin"
fi;
BASE_FOLDER=$(dirname "$(readlink -f "$0")")"/";
# shellcheck source=init.sh
. "${BASE_FOLDER}init.sh";
if [ -z "${REMOTE_HOST}" ]; then
echo "Must set a remote host for the repository";
exit;
fi;
echo "New clone";
echo ${GIT_COMMAND} clone -b "${BRANCH}" --single-branch --depth 1 --origin "${REMOTE}" "${REMOTE_HOST}:${REPOSITORY}" "${GIT_REPOSITORY_FOLDER}${CLONE_BASE}";
# __END__