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