clone debugged
This commit is contained in:
parent
db10baf460
commit
90cc774341
@ -1,6 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
|
||||||
REPOS=(
|
REPOS=(
|
||||||
"oc-auth"
|
"oc-auth"
|
||||||
"oc-catalog"
|
"oc-catalog"
|
||||||
@ -19,7 +18,7 @@ REPOS=(
|
|||||||
clone_repo() {
|
clone_repo() {
|
||||||
local repo_url="https://cloud.o-forge.io/core/$1.git"
|
local repo_url="https://cloud.o-forge.io/core/$1.git"
|
||||||
local repo_name=$(basename "$repo_url" .git)
|
local repo_name=$(basename "$repo_url" .git)
|
||||||
local branch=$2
|
local branche=$2
|
||||||
echo "Processing repository: $repo_name"
|
echo "Processing repository: $repo_name"
|
||||||
|
|
||||||
if [ ! -d "$repo_name" ]; then
|
if [ ! -d "$repo_name" ]; then
|
||||||
@ -31,17 +30,18 @@ clone_repo() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "Repository '$repo_name' already exists. Pulling latest changes..."
|
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 ..
|
cd ..
|
||||||
# Iterate through each repository in the list
|
# Iterate through each repository in the list
|
||||||
branch = "main"
|
branche = "main"
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
branch = $1
|
branche = $1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for repo in "${REPOS[@]}"; do
|
for repo in "${REPOS[@]}"; do
|
||||||
clone_repo $repo $branch
|
clone_repo $repo $branche
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "All repositories processed successfully."
|
echo "All repositories processed successfully."
|
||||||
|
Loading…
Reference in New Issue
Block a user