adjustment script clone

This commit is contained in:
mr 2025-03-27 13:12:23 +01:00
parent c79db0b3de
commit cb3d135d6c

View File

@ -23,10 +23,7 @@ clone_repo() {
echo "Processing repository: $repo_name" echo "Processing repository: $repo_name"
if [ -d "$repo_name" ]; then if [ !-d "$repo_name" ]; then
echo "Repository '$repo_name' already exists. Pulling latest changes..."
cd "$repo_name" && git checkout $branch && git pull && cd ..
else
echo "Cloning repository: $repo_name" echo "Cloning repository: $repo_name"
git clone "$repo_url" git clone "$repo_url"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -34,6 +31,8 @@ clone_repo() {
exit 1 exit 1
fi fi
fi fi
echo "Repository '$repo_name' already exists. Pulling latest changes..."
cd "$repo_name" && git checkout $branch && git pull && cd ..
} }
branch=${1:-main} branch=${1:-main}
# Iterate through each repository in the list # Iterate through each repository in the list