Commit 785a6067 authored by Ansgar Burchardt's avatar Ansgar Burchardt

Merge remote-tracking branch 'dokempf/feature/recursive-option'

parents e934a7a1 823eea49
Pipeline #1087 passed with stages
in 67 minutes and 41 seconds
......@@ -9,6 +9,7 @@ usage() {
echo >&2
echo "options:" >&2
echo " -b <branch>, --branch <branch>: Install branch <branch> of the module." >&2
echo " -r, --recursive: Clone the git repository with --recursive (for git submodules)." >&2
echo >&2
echo "environment variables:" >&2
echo " DUNECI_BRANCH:" >&2
......@@ -26,6 +27,7 @@ fi
branch="${DUNECI_BRANCH:-}"
recursive=
while :; do
case "${1}" in
......@@ -33,6 +35,10 @@ while :; do
branch="${2}"
shift 2
;;
-r|--recursive)
recursive=1
shift 1
;;
*)
break
;;
......@@ -53,6 +59,9 @@ git_clone_opts=(--depth=1 --no-single-branch)
if [[ -n "${branch}" ]]; then
git_clone_opts+=(-b "${branch}")
fi
if [[ -n "${recursive}" ]]; then
git_clone_opts+=("--recursive")
fi
git clone "${git_clone_opts[@]}" "${repo}"
if [[ "${DUNECI_BRANCH_AUTO:-1}" = "1" && -n "${CI_BUILD_REF_NAME:-}" ]]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment