From cb3d135d6c66761b814bd376210d2c129a11feb8 Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 27 Mar 2025 13:12:23 +0100 Subject: [PATCH] adjustment script clone --- clone_opencloud_microservices.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clone_opencloud_microservices.sh b/clone_opencloud_microservices.sh index 2bd4bb5..03dfe77 100755 --- a/clone_opencloud_microservices.sh +++ b/clone_opencloud_microservices.sh @@ -23,10 +23,7 @@ clone_repo() { echo "Processing repository: $repo_name" - if [ -d "$repo_name" ]; then - echo "Repository '$repo_name' already exists. Pulling latest changes..." - cd "$repo_name" && git checkout $branch && git pull && cd .. - else + if [ !-d "$repo_name" ]; then echo "Cloning repository: $repo_name" git clone "$repo_url" if [ $? -ne 0 ]; then @@ -34,6 +31,8 @@ clone_repo() { exit 1 fi fi + echo "Repository '$repo_name' already exists. Pulling latest changes..." + cd "$repo_name" && git checkout $branch && git pull && cd .. } branch=${1:-main} # Iterate through each repository in the list