clone debugged

This commit is contained in:
mr 2025-04-29 10:30:28 +02:00
parent db10baf460
commit 90cc774341

View File

@ -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."