From 90cc77434128ecfc713815af32e871249fcff1d6 Mon Sep 17 00:00:00 2001 From: mr Date: Tue, 29 Apr 2025 10:30:28 +0200 Subject: [PATCH] clone debugged --- clone_opencloud_microservices.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/clone_opencloud_microservices.sh b/clone_opencloud_microservices.sh index d55649c..ef8f051 100755 --- a/clone_opencloud_microservices.sh +++ b/clone_opencloud_microservices.sh @@ -1,6 +1,5 @@ #!/bin/bash - REPOS=( "oc-auth" "oc-catalog" @@ -19,7 +18,7 @@ REPOS=( clone_repo() { local repo_url="https://cloud.o-forge.io/core/$1.git" local repo_name=$(basename "$repo_url" .git) - local branch=$2 + local branche=$2 echo "Processing repository: $repo_name" if [ ! -d "$repo_name" ]; then @@ -31,17 +30,18 @@ clone_repo() { fi fi echo "Repository '$repo_name' already exists. Pulling latest changes..." - cd "$repo_name" && git pull origin $branch && cd .. + cd "$repo_name" && git checkout $branche && git pull && cd .. } cd .. # Iterate through each repository in the list -branch = "main" +branche = "main" if [ -n "$1" ]; then - branch = $1 + branche = $1 fi + for repo in "${REPOS[@]}"; do - clone_repo $repo $branch + clone_repo $repo $branche done echo "All repositories processed successfully."