Basic script check in
This is not completed and under development
This commit is contained in:
23
bin/new_clone.sh
Executable file
23
bin/new_clone.sh
Executable 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__
|
||||
Reference in New Issue
Block a user